Skip to content

Commit 1ef15f1

Browse files
chore[py]: duckdb py test for timestamp xfail (#5862)
Signed-off-by: Joe Isaacs <[email protected]>
1 parent fdb1286 commit 1ef15f1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

vortex-python/test/test_duckdb.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
"""Test for timestamp filtering with DuckDB via vortex extension and PyArrow dataset interface."""
5+
6+
from datetime import datetime
7+
from pathlib import Path
8+
9+
import duckdb
10+
import pyarrow as pa
11+
import pytest
12+
13+
import vortex as vx
14+
15+
16+
@pytest.mark.xfail(reason="is_not_null not yet implemented in substrait conversion")
17+
def test_duckdb_via_substrait(tmp_path: Path) -> None:
18+
con = duckdb.connect()
19+
20+
arr = pa.array([datetime(2024, 1, 1), datetime(2024, 6, 15), datetime(2024, 12, 31)])
21+
table = pa.table({"ts": arr})
22+
path = str(tmp_path / "test_timestamp.vortex")
23+
vx.io.write(table, path)
24+
25+
ds = vx.open(path).to_dataset() # noqa: F841 # pyright: ignore[reportUnusedVariable] - used by duckdb via SQL
26+
result = con.execute("SELECT * FROM ds WHERE ts > '2024-06-01'").fetchall()
27+
print(result)

0 commit comments

Comments
 (0)