|
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, |
|
185 | 186 | from pyiceberg.utils.datetime import millis_to_datetime |
186 | 187 | from pyiceberg.utils.decimal import unscaled_to_decimal |
187 | 188 | from pyiceberg.utils.deprecated import deprecation_message |
188 | | -from pyiceberg.utils.properties import get_first_property_value, property_as_bool, property_as_int |
| 189 | +from pyiceberg.utils.properties import get_first_property_value, property_as_bool, property_as_int, strtobool |
189 | 190 | from pyiceberg.utils.singleton import Singleton |
190 | 191 | from pyiceberg.utils.truncate import truncate_upper_bound_binary_string, truncate_upper_bound_text_string |
191 | 192 |
|
@@ -450,6 +451,9 @@ def _initialize_oss_fs(self) -> FileSystem: |
450 | 451 | if session_name := get_first_property_value(self.properties, S3_ROLE_SESSION_NAME, AWS_ROLE_SESSION_NAME): |
451 | 452 | client_kwargs["session_name"] = session_name |
452 | 453 |
|
| 454 | + if s3_anonymous := self.properties.get(S3_ANONYMOUS): |
| 455 | + client_kwargs["anonymous"] = strtobool(s3_anonymous) |
| 456 | + |
453 | 457 | return S3FileSystem(**client_kwargs) |
454 | 458 |
|
455 | 459 | def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem: |
@@ -501,6 +505,9 @@ def _initialize_s3_fs(self, netloc: Optional[str]) -> FileSystem: |
501 | 505 | ): |
502 | 506 | client_kwargs["retry_strategy"] = retry_instance |
503 | 507 |
|
| 508 | + if s3_anonymous := self.properties.get(S3_ANONYMOUS): |
| 509 | + client_kwargs["anonymous"] = strtobool(s3_anonymous) |
| 510 | + |
504 | 511 | return S3FileSystem(**client_kwargs) |
505 | 512 |
|
506 | 513 | def _initialize_azure_fs(self) -> FileSystem: |
@@ -2793,9 +2800,11 @@ def _determine_partitions(spec: PartitionSpec, schema: Schema, arrow_table: pa.T |
2793 | 2800 | functools.reduce( |
2794 | 2801 | operator.and_, |
2795 | 2802 | [ |
2796 | | - pc.field(partition_field_name) == unique_partition[partition_field_name] |
2797 | | - if unique_partition[partition_field_name] is not None |
2798 | | - else pc.field(partition_field_name).is_null() |
| 2803 | + ( |
| 2804 | + pc.field(partition_field_name) == unique_partition[partition_field_name] |
| 2805 | + if unique_partition[partition_field_name] is not None |
| 2806 | + else pc.field(partition_field_name).is_null() |
| 2807 | + ) |
2799 | 2808 | for field, partition_field_name in zip(spec.fields, partition_fields) |
2800 | 2809 | ], |
2801 | 2810 | ) |
|
0 commit comments