Skip to content

Commit b3a6c68

Browse files
committed
get rid of oss prefix
1 parent 4b1ff31 commit b3a6c68

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

mkdocs/docs/configuration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Use this format for additional properties:
239239

240240
Where:
241241

242-
- `{fs_scheme}` is the filesystem scheme (e.g., `s3`, `hdfs`, `gcs`, `adls`, `oss`, `file`)
242+
- `{fs_scheme}` is the filesystem scheme (e.g., `s3`, `hdfs`, `gcs`, `adls`, `file`)
243243
- `{parameter_name}` must match the exact parameter name expected by the PyArrow filesystem constructor
244244
- `{value}` must be the correct type expected by the underlying filesystem (string, integer, boolean, etc.)
245245

@@ -251,7 +251,6 @@ Where:
251251
| `hdfs.` | [HadoopFileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.HadoopFileSystem.html) | `hdfs.replication=3` | Passed as `replication=3` to HadoopFileSystem |
252252
| `gcs.` | [GcsFileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.GcsFileSystem.html) | `gcs.project_id=test` | Passed as `project_id='test'` to GcsFileSystem |
253253
| `adls.` | [AzureFileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.AzureFileSystem.html) | `adls.account_name=foo` | Passed as `account_name=foo` to AzureFileSystem |
254-
| `oss.` | [S3FileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.S3FileSystem.html) | `oss.connect_timeout=30.0` | Passed as `connect_timeout=30.0` to S3FileSystem |
255254
| `file.` | [LocalFileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.LocalFileSystem.html) | `file.use_mmap=true` | Passed as `use_mmap=True` to LocalFileSystem |
256255

257256
**Note:** Refer to the PyArrow documentation for each filesystem to understand the available parameters and their expected types. Property values are passed directly to PyArrow, so they must match the exact parameter names and types expected by the filesystem constructors.

pyiceberg/io/pyarrow.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -478,40 +478,40 @@ def _resolve_s3_region(
478478
def _initialize_oss_fs(self) -> FileSystem:
479479
from pyarrow.fs import S3FileSystem
480480

481-
properties = filter_properties(self.properties, key_predicate=lambda k: k.startswith(("s3.", "client.", "oss.")))
481+
properties = filter_properties(self.properties, key_predicate=lambda k: k.startswith(("s3.", "client.")))
482482
used_keys: set[str] = set()
483483
get = lambda *keys: self._get_first_property_value_with_tracking(properties, used_keys, *keys) # noqa: E731
484484
client_kwargs: Properties = {}
485485

486-
if endpoint := get(S3_ENDPOINT, "oss.endpoint_override"):
486+
if endpoint := get(S3_ENDPOINT, "s3.endpoint_override"):
487487
client_kwargs["endpoint_override"] = endpoint
488-
if access_key := get(S3_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, "oss.access_key"):
488+
if access_key := get(S3_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, "s3.access_key"):
489489
client_kwargs["access_key"] = access_key
490-
if secret_key := get(S3_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, "oss.secret_key"):
490+
if secret_key := get(S3_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, "s3.secret_key"):
491491
client_kwargs["secret_key"] = secret_key
492-
if session_token := get(S3_SESSION_TOKEN, AWS_SESSION_TOKEN, "oss.session_token"):
492+
if session_token := get(S3_SESSION_TOKEN, AWS_SESSION_TOKEN, "s3.session_token"):
493493
client_kwargs["session_token"] = session_token
494-
if region := get(S3_REGION, AWS_REGION, "oss.region"):
494+
if region := get(S3_REGION, AWS_REGION):
495495
client_kwargs["region"] = region
496-
if force_virtual_addressing := get(S3_FORCE_VIRTUAL_ADDRESSING, "oss.force_virtual_addressing"):
496+
if force_virtual_addressing := get(S3_FORCE_VIRTUAL_ADDRESSING, "s3.force_virtual_addressing"):
497497
client_kwargs["force_virtual_addressing"] = self._convert_str_to_bool(force_virtual_addressing)
498498
else:
499-
# For OSS FS, default to True
499+
# For Alibaba OSS protocol, default to True
500500
client_kwargs["force_virtual_addressing"] = True
501-
if proxy_uri := get(S3_PROXY_URI, "oss.proxy_options"):
501+
if proxy_uri := get(S3_PROXY_URI, "s3.proxy_options"):
502502
client_kwargs["proxy_options"] = proxy_uri
503-
if connect_timeout := get(S3_CONNECT_TIMEOUT, "oss.connect_timeout"):
503+
if connect_timeout := get(S3_CONNECT_TIMEOUT, "s3.connect_timeout"):
504504
client_kwargs["connect_timeout"] = float(connect_timeout)
505-
if request_timeout := get(S3_REQUEST_TIMEOUT, "oss.request_timeout"):
505+
if request_timeout := get(S3_REQUEST_TIMEOUT, "s3.request_timeout"):
506506
client_kwargs["request_timeout"] = float(request_timeout)
507-
if role_arn := get(S3_ROLE_ARN, AWS_ROLE_ARN, "oss.role_arn"):
507+
if role_arn := get(S3_ROLE_ARN, AWS_ROLE_ARN, "s3.role_arn"):
508508
client_kwargs["role_arn"] = role_arn
509-
if session_name := get(S3_ROLE_SESSION_NAME, AWS_ROLE_SESSION_NAME, "oss.session_name"):
509+
if session_name := get(S3_ROLE_SESSION_NAME, AWS_ROLE_SESSION_NAME, "s3.session_name"):
510510
client_kwargs["session_name"] = session_name
511511

512-
# get the rest of the properties with the `oss.` prefix that are not already evaluated
513-
remaining_oss_props = properties_with_prefix({k: v for k, v in self.properties.items() if k not in used_keys}, "oss.")
514-
client_kwargs = {**remaining_oss_props, **client_kwargs}
512+
# get the rest of the properties with the `s3.` prefix that are not already evaluated
513+
remaining_s3_props = properties_with_prefix({k: v for k, v in self.properties.items() if k not in used_keys}, "s3.")
514+
client_kwargs = {**remaining_s3_props, **client_kwargs}
515515
return S3FileSystem(**client_kwargs)
516516

517517
def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem:

0 commit comments

Comments
 (0)