YannByron commented on code in PR #8029:
URL: https://github.com/apache/paimon/pull/8029#discussion_r3322937871
##########
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:
Maybe it's fine to call `identifier.get_database_name` and
`identifier.get_table_name` directly, not though `getattr`.
--
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]