Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JSchlensok committed Jun 13, 2024
1 parent 0582608 commit 53c65d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit_tests/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
import pyarrow.parquet as pq
import pytest
import scipy

if "typeguard" in sys.modules:
from typeguard import suppress_type_checks

from spectrum_io.file import parquet


class TestParquet:
"""Test class to check Parquet file I/O."""

Expand Down Expand Up @@ -57,15 +59,15 @@ def test_modify_partition(self, raw_data, tmpdir):
def test_write_not_implemented(self, raw_data, tmpdir):
"""Check whether write_file() raises a NotImplementedError if provided with an unsupported object."""
with pytest.raises(NotImplementedError):
with (suppress_type_checks() if "typeguard" in sys.modules else nullcontext()):
with suppress_type_checks() if "typeguard" in sys.modules else nullcontext():
output_path = Path(tmpdir / "table.parquet")
df = pd.DataFrame(raw_data).to_numpy()
parquet.write_file(df, output_path)

def test_read_write_partition_not_implemented(self, raw_data, tmpdir):
"""Check whether write_partition() raises a NotImplementedError if provided with an unsupported object."""
with pytest.raises(NotImplementedError):
with (suppress_type_checks() if "typeguard" in sys.modules else nullcontext()):
with suppress_type_checks() if "typeguard" in sys.modules else nullcontext():
output_path = Path(tmpdir / "partition")
df = pd.DataFrame(raw_data).to_numpy()
parquet.write_partition([df, df], output_path, ["dataset_1", "dataset_2"])
Expand Down

0 comments on commit 53c65d0

Please sign in to comment.