|
109 | 109 | HDFS_USER, |
110 | 110 | PYARROW_USE_LARGE_TYPES_ON_READ, |
111 | 111 | S3_ACCESS_KEY_ID, |
| 112 | + S3_ANONYMOUS, |
112 | 113 | S3_CONNECT_TIMEOUT, |
113 | 114 | S3_ENDPOINT, |
114 | 115 | S3_FORCE_VIRTUAL_ADDRESSING, |
|
179 | 180 | TimeType, |
180 | 181 | UnknownType, |
181 | 182 | UUIDType, |
| 183 | + strtobool, |
182 | 184 | ) |
183 | 185 | from pyiceberg.utils.concurrent import ExecutorFactory |
184 | 186 | from pyiceberg.utils.config import Config |
@@ -450,6 +452,9 @@ def _initialize_oss_fs(self) -> FileSystem: |
450 | 452 | if session_name := get_first_property_value(self.properties, S3_ROLE_SESSION_NAME, AWS_ROLE_SESSION_NAME): |
451 | 453 | client_kwargs["session_name"] = session_name |
452 | 454 |
|
| 455 | + if s3_anonymous := self.properties.get(S3_ANONYMOUS): |
| 456 | + client_kwargs["anonymous"] = strtobool(s3_anonymous) |
| 457 | + |
453 | 458 | return S3FileSystem(**client_kwargs) |
454 | 459 |
|
455 | 460 | def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem: |
@@ -501,6 +506,9 @@ def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem: |
501 | 506 | ): |
502 | 507 | client_kwargs["retry_strategy"] = retry_instance |
503 | 508 |
|
| 509 | + if s3_anonymous := self.properties.get(S3_ANONYMOUS): |
| 510 | + client_kwargs["anonymous"] = strtobool(s3_anonymous) |
| 511 | + |
504 | 512 | return S3FileSystem(**client_kwargs) |
505 | 513 |
|
506 | 514 | def _initialize_azure_fs(self) -> FileSystem: |
@@ -2797,9 +2805,11 @@ def _determine_partitions(spec: PartitionSpec, schema: Schema, arrow_table: pa.T |
2797 | 2805 | functools.reduce( |
2798 | 2806 | operator.and_, |
2799 | 2807 | [ |
2800 | | - pc.field(partition_field_name) == unique_partition[partition_field_name] |
2801 | | - if unique_partition[partition_field_name] is not None |
2802 | | - else pc.field(partition_field_name).is_null() |
| 2808 | + ( |
| 2809 | + pc.field(partition_field_name) == unique_partition[partition_field_name] |
| 2810 | + if unique_partition[partition_field_name] is not None |
| 2811 | + else pc.field(partition_field_name).is_null() |
| 2812 | + ) |
2803 | 2813 | for field, partition_field_name in zip(spec.fields, partition_fields) |
2804 | 2814 | ], |
2805 | 2815 | ) |
|
0 commit comments