-
Notifications
You must be signed in to change notification settings - Fork 326
Added force virtual addressing configuration for S3, Alibaba OSS protocol to use PyArrowFileIO #1392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added force virtual addressing configuration for S3, Alibaba OSS protocol to use PyArrowFileIO #1392
Changes from all commits
5b24172
360e305
31291f4
6575552
282bd47
7315525
727666d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -102,6 +102,7 @@ | |||||||||||||||||||||||
S3_ACCESS_KEY_ID, | ||||||||||||||||||||||||
S3_CONNECT_TIMEOUT, | ||||||||||||||||||||||||
S3_ENDPOINT, | ||||||||||||||||||||||||
S3_FORCE_VIRTUAL_ADDRESSING, | ||||||||||||||||||||||||
S3_PROXY_URI, | ||||||||||||||||||||||||
S3_REGION, | ||||||||||||||||||||||||
S3_ROLE_ARN, | ||||||||||||||||||||||||
|
@@ -350,7 +351,7 @@ def parse_location(location: str) -> Tuple[str, str, str]: | |||||||||||||||||||||||
return uri.scheme, uri.netloc, f"{uri.netloc}{uri.path}" | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
def _initialize_fs(self, scheme: str, netloc: Optional[str] = None) -> FileSystem: | ||||||||||||||||||||||||
if scheme in {"s3", "s3a", "s3n"}: | ||||||||||||||||||||||||
if scheme in {"s3", "s3a", "s3n", "oss"}: | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets also update the docs to mention There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we also add iceberg-python/pyiceberg/io/fsspec.py Lines 245 to 255 in 68e17af
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like theres https://github.com/fsspec/ossfs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The project hasn't been maintained for almost a year now, and when I tried it on DuckDB it returns an unknown dependency error (?). I'd say it's probably safer to use s3fs than ossfs (not that I've tried it, though). I'll try making a new pull request for that later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense, thanks for looking into it! lets keep the scope just pyarrow for now |
||||||||||||||||||||||||
from pyarrow.fs import S3FileSystem | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
client_kwargs: Dict[str, Any] = { | ||||||||||||||||||||||||
|
@@ -373,6 +374,9 @@ def _initialize_fs(self, scheme: str, netloc: Optional[str] = None) -> FileSyste | |||||||||||||||||||||||
if session_name := get_first_property_value(self.properties, S3_ROLE_SESSION_NAME, AWS_ROLE_SESSION_NAME): | ||||||||||||||||||||||||
client_kwargs["session_name"] = session_name | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
if force_virtual_addressing := self.properties.get(S3_FORCE_VIRTUAL_ADDRESSING): | ||||||||||||||||||||||||
client_kwargs["force_virtual_addressing"] = property_as_bool(self.properties, force_virtual_addressing, False) | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
return S3FileSystem(**client_kwargs) | ||||||||||||||||||||||||
elif scheme in ("hdfs", "viewfs"): | ||||||||||||||||||||||||
from pyarrow.fs import HadoopFileSystem | ||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.