Fokko commented on code in PR #1709:
URL: https://github.com/apache/iceberg-python/pull/1709#discussion_r1966885810
##########
pyiceberg/io/pyarrow.py:
##########
@@ -414,19 +421,19 @@ def _initialize_oss_fs(self) -> FileSystem:
return S3FileSystem(**client_kwargs)
def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem:
- from pyarrow.fs import S3FileSystem, resolve_s3_region
+ from pyarrow.fs import S3FileSystem
# Resolve region from netloc(bucket), fallback to user-provided region
provided_region = get_first_property_value(self.properties, S3_REGION,
AWS_REGION)
try:
- bucket_region = resolve_s3_region(bucket=netloc)
+ bucket_region = _cached_resolve_s3_region(bucket=netloc)
except (OSError, TypeError):
bucket_region = None
logger.warning(f"Unable to resolve region for bucket {netloc},
using default region {provided_region}")
Review Comment:
Hey @hussein-awala Thanks for jumping in here, and I really like your
suggestion. Just pushed the suggestion, LMKWYT.
> Or do we need to warn the user every time it fails to resolve the netloc?
I was surprised by hearing that folks are seeing multiple warnings, since
Python [only warns once by
design](https://docs.python.org/3/library/warnings.html):
> Repetitions of a particular warning for the same source location are
typically suppressed.
--
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]