jayceslesar commented on code in PR #1542:
URL: https://github.com/apache/iceberg-python/pull/1542#discussion_r1922933602


##########
tests/integration/test_reads.py:
##########
@@ -950,3 +951,30 @@ def test_read_from_s3_and_local_fs(catalog: Catalog, 
tmp_path: PosixPath) -> Non
 
     result_table = tbl.scan().to_arrow()
     assert result_table["colA"].to_pylist() == ["one", "one"]
+
+
+@pytest.mark.integration
+@pytest.mark.parametrize("catalog", 
[pytest.lazy_fixture("session_catalog_hive"), 
pytest.lazy_fixture("session_catalog")])
+def test_scan_with_datetime(catalog: Catalog) -> None:
+    table = create_table(catalog)
+
+    yesterday = datetime.now() - timedelta(days=1)
+    table.append(
+        pa.Table.from_pylist(
+            [
+                {
+                    "str": "foo",
+                    "int": 1,
+                    "bool": True,
+                    "datetime": yesterday,
+                }
+            ],
+            schema=table.schema().as_arrow(),
+        ),
+    )
+
+    df = table.scan(row_filter=GreaterThanOrEqual("datetime", 
yesterday)).to_pandas()
+    assert len(df) == 1
+
+    df = table.scan(row_filter=LessThan("datetime", yesterday)).to_pandas()
+    assert len(df) == 0

Review Comment:
   could parameterize this but tbh easier to read this way



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to