Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Apr 23, 2024
1 parent 8b99a47 commit 0a5aeb2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,3 +1528,25 @@ def test_rust_decimal_cast(tmp_path: pathlib.Path):
write_deltalake(
tmp_path, data, mode="append", schema_mode="merge", engine="rust"
)


@pytest.mark.parametrize(
"array",
[
pa.array([[datetime(2010, 1, 1)]]),
pa.array([{"foo": datetime(2010, 1, 1)}]),
pa.array([{"foo": [[datetime(2010, 1, 1)]]}]),
pa.array([{"foo": [[{"foo": datetime(2010, 1, 1)}]]}]),
],
)
def test_write_timestamp_ntz_nested(tmp_path: pathlib.Path, array: pa.array):
data = pa.table({"x": array})
write_deltalake(tmp_path, data, mode="append", engine="rust")

dt = DeltaTable(tmp_path)

protocol = dt.protocol()
assert protocol.min_reader_version == 3
assert protocol.min_writer_version == 7
assert protocol.reader_features == ["timestampNtz"]
assert protocol.writer_features == ["timestampNtz"]

0 comments on commit 0a5aeb2

Please sign in to comment.