-
Notifications
You must be signed in to change notification settings - Fork 211
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
feat: support datetime objects in literal instantiation #1542
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
import math | ||
import time | ||
import uuid | ||
from datetime import datetime | ||
from pathlib import PosixPath | ||
from urllib.parse import urlparse | ||
|
||
|
@@ -950,3 +951,11 @@ 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) | ||
# test that this doesn't raise an exception... | ||
table.scan(row_filter=GreaterThanOrEqual("datetime", datetime.now())).to_pandas() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the table has maybe something like,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, looking much better now, took me too long to figure out I can run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
tzinfo
is handled here:iceberg-python/pyiceberg/utils/datetime.py
Lines 75 to 81 in 3981e62