kerwin-zk commented on code in PR #8029:
URL: https://github.com/apache/paimon/pull/8029#discussion_r3323542938


##########
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:
   Done. Added a `properties` property on `CachingFileIO` that delegates to its 
`_delegate`, so every `FileIO` implementation now exposes `.properties` 
uniformly. `_extract_catalog_options` reads `table.file_io.properties` 
directly, with no per-implementation `getattr`.



##########
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)
+    return _options_to_dict(properties)
+
+
+def _extract_identifier(table: FileStoreTable) -> _PaimonIdentifier | None:
+    identifier = getattr(table, "identifier", None)
+    if identifier is None:
+        return None
+
+    get_database_name = getattr(identifier, "get_database_name", None)

Review Comment:
   Done, calling `identifier.get_database_name()` / `get_table_name()` / 
`get_branch_name()` directly now. This also fixes a latent issue: the old 
`getattr` fallback used `identifier.object`, which is the encoded object name 
and would round-trip incorrectly for branch tables.



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