Skip to content

Commit 9ecb7af

Browse files
committed
modify pandas reader test
1 parent 7c89361 commit 9ecb7af

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/nested_pandas/nestedframe/test_io.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pyarrow as pa
66
import pytest
77
from nested_pandas import read_parquet
8+
from nested_pandas.datasets import generate_data
89
from pandas.testing import assert_frame_equal
910

1011

@@ -124,8 +125,12 @@ def test_to_parquet():
124125

125126
def test_pandas_read_parquet():
126127
"""Test that pandas can read our serialized files"""
127-
# Load in the example file
128-
df = pd.read_parquet("tests/test_data/nested.parquet")
129128

130-
# Check the columns
131-
assert df.columns.tolist() == ["a", "flux", "nested", "lincc"]
129+
nf = generate_data(10, 100, seed=1)
130+
with tempfile.TemporaryDirectory() as tmpdir:
131+
nf.to_parquet(os.path.join(tmpdir, "nested_for_pd.parquet"))
132+
# Load in the example file
133+
df = pd.read_parquet(os.path.join(tmpdir, "nested_for_pd.parquet"))
134+
135+
# Check the columns
136+
assert df.columns.tolist() == ["a", "b", "nested"]

0 commit comments

Comments
 (0)