Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure writing works with partition_freq #44

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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 @@ -36,9 +37,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,
)
# FIXME: us is the only precision delta supports. This lib should likely
Expand All @@ -59,6 +59,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)