rambleraptor commented on code in PR #4094:
URL: https://github.com/apache/iceberg-python/pull/4094#discussion_r4541674692
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -593,6 +611,17 @@ def __init__(self, name: str, **properties: str):
self.uri = properties[URI]
self._fetch_config()
self._session = self._create_session()
+ max_entries = int(self.properties.get(REST_TABLE_CACHE_MAX_ENTRIES,
REST_TABLE_CACHE_MAX_ENTRIES_DEFAULT))
+ ttl_ms =
int(self.properties.get(REST_TABLE_CACHE_EXPIRE_AFTER_WRITE_MS,
REST_TABLE_CACHE_EXPIRE_AFTER_WRITE_MS_DEFAULT))
+ if ttl_ms <= 0:
+ raise ValueError(f"Invalid value for
{REST_TABLE_CACHE_EXPIRE_AFTER_WRITE_MS}: {ttl_ms} (must be positive)")
+ self._table_cache = TTLCache(maxsize=max_entries, ttl=ttl_ms / 1000)
if max_entries > 0 else None
+ self._table_cache_lock = threading.Lock()
Review Comment:
This prevents the table from being pickled.
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -355,6 +365,12 @@ def _uuid7() -> uuid.UUID:
return uuid.UUID(int=value)
+def _is_short_lived_credential(key: str) -> bool:
+ """Whether a loadTable config key carries a short-lived storage
credential."""
+ key = key.lower()
+ return key in (S3_SESSION_TOKEN, GCS_TOKEN) or
key.startswith(ADLS_SAS_TOKEN)
Review Comment:
I think we need to add `client.session-token`, `adls.token` and `token` here
as well.
--
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]