qzyu999 commented on code in PR #3596:
URL: https://github.com/apache/iceberg-python/pull/3596#discussion_r3833819754
##########
pyiceberg/table/__init__.py:
##########
@@ -116,9 +117,38 @@
from pyiceberg.catalog.rest.scan_planning import RESTContentFile,
RESTDeleteFile, RESTFileScanTask
ALWAYS_TRUE = AlwaysTrue()
+DOWNCAST_NS_TIMESTAMP_TO_US = "downcast-ns-timestamp-to-us"
+# Deprecated: use DOWNCAST_NS_TIMESTAMP_TO_US. The old key said "on-write" but
the
+# config also controls read-path downcasting, so the name was misleading.
DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE = "downcast-ns-timestamp-to-us-on-write"
+def get_downcast_ns_timestamp_to_us() -> bool:
+ """Return the effective value of the downcast-ns-timestamp-to-us config.
+
+ Checks the new ``downcast-ns-timestamp-to-us`` key first. If not set, falls
+ back to the deprecated ``downcast-ns-timestamp-to-us-on-write`` key and
+ emits a :class:`DeprecationWarning` so callers can migrate their config.
+ """
+ config = Config()
+
+ value = config.get_bool(DOWNCAST_NS_TIMESTAMP_TO_US)
+ if value is not None:
+ return value
+
+ legacy = config.get_bool(DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE)
+ if legacy is not None:
+ deprecation_message(
+ deprecated_in="0.9.0",
+ removed_in="0.10.0",
Review Comment:
Thanks for confirming, I should've double-checked previously, made the
changes.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]