YannByron commented on code in PR #8029:
URL: https://github.com/apache/paimon/pull/8029#discussion_r3322883833


##########
paimon-python/pypaimon/daft/daft_datasource.py:
##########
@@ -63,6 +64,113 @@ class _ReadPushdownState:
     source_limit: int | None
 
 
+def _options_to_dict(options: Any) -> dict[str, Any]:
+    if options is None:
+        return {}
+    if isinstance(options, dict):
+        return dict(options)
+
+    to_map = getattr(options, "to_map", None)
+    if callable(to_map):
+        return dict(to_map())
+
+    data = getattr(options, "data", None)
+    if isinstance(data, dict):
+        return dict(data)
+
+    return {}
+
+
+def _extract_catalog_options(table: FileStoreTable) -> dict[str, Any]:
+    file_io = getattr(table, "file_io", None)
+    properties = getattr(file_io, "properties", None)
+    if properties is None:
+        properties = getattr(file_io, "catalog_options", None)

Review Comment:
   We can all obtain properties information through the `properties` attribute, 
even for `RESTTokenFileIO`. However, we need to determine whether it is 
`CachingFileIO` (in which case it needs to be obtained from `_delegate`) to 
increase code robustness.
   I further recommend unifying the abstract `properties` API for `FileIO` on 
the pypaimon side. Because we currently have too many `getattr` calls.



-- 
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]

Reply via email to