Skip to content

Commit

Permalink
Ensure writing works with partition_freq (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bennet authored Jul 12, 2023
1 parent daa8dc9 commit 045481b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
False,
],
)
def test_roundtrip(tmpdir, with_index):
@pytest.mark.parametrize("freq,partition_freq", [("1H", "1D"), ("1H", "1w")])
def test_roundtrip(tmpdir, with_index, freq, partition_freq):
dtypes = {
"str": object,
# FIXME: Categorical data does not work
Expand All @@ -38,9 +39,8 @@ def test_roundtrip(tmpdir, with_index):
ddf = timeseries(
start="2023-01-01",
end="2023-01-15",
# FIXME: Setting the partition frequency destroys the roundtrip for some
# reason
# partition_freq="1w",
freq=freq,
partition_freq=partition_freq,
dtypes=dtypes,
)

Expand All @@ -58,6 +58,7 @@ def test_roundtrip(tmpdir, with_index):
if with_index:
ddf = ddf.reset_index()

assert ddf.npartitions == ddf_read.npartitions
# By default, arrow reads with ns resolution
ddf.timestamp = ddf.timestamp.astype("datetime64[ns]")
assert_eq(ddf, ddf_read)
Expand Down

0 comments on commit 045481b

Please sign in to comment.