diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 0c8c848c4..f2df84d7e 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -190,7 +190,7 @@ class TableProperties: WRITE_PY_LOCATION_PROVIDER_IMPL = "write.py-location-provider.impl" OBJECT_STORE_ENABLED = "write.object-storage.enabled" - OBJECT_STORE_ENABLED_DEFAULT = False + OBJECT_STORE_ENABLED_DEFAULT = True WRITE_OBJECT_STORE_PARTITIONED_PATHS = "write.object-storage.partitioned-paths" WRITE_OBJECT_STORE_PARTITIONED_PATHS_DEFAULT = True diff --git a/tests/integration/test_writes/test_partitioned_writes.py b/tests/integration/test_writes/test_partitioned_writes.py index 50a1bc8c3..9e7632852 100644 --- a/tests/integration/test_writes/test_partitioned_writes.py +++ b/tests/integration/test_writes/test_partitioned_writes.py @@ -294,11 +294,13 @@ def test_object_storage_location_provider_excludes_partition_path( PartitionField(source_id=nested_field.field_id, field_id=1001, transform=IdentityTransform(), name=part_col) ) + # write.object-storage.enabled and write.object-storage.partitioned-paths don't need to be specified as they're on by default + assert TableProperties.OBJECT_STORE_ENABLED_DEFAULT + assert TableProperties.WRITE_OBJECT_STORE_PARTITIONED_PATHS_DEFAULT tbl = _create_table( session_catalog=session_catalog, identifier=f"default.arrow_table_v{format_version}_with_null_partitioned_on_col_{part_col}", - # write.object-storage.partitioned-paths defaults to True - properties={"format-version": str(format_version), TableProperties.OBJECT_STORE_ENABLED: True}, + properties={"format-version": str(format_version)}, data=[arrow_table_with_null], partition_spec=partition_spec, ) diff --git a/tests/table/test_locations.py b/tests/table/test_locations.py index bda2442ac..6753fe5a2 100644 --- a/tests/table/test_locations.py +++ b/tests/table/test_locations.py @@ -39,7 +39,7 @@ def new_data_location(self, data_file_name: str, partition_key: Optional[Partiti def test_default_location_provider() -> None: - provider = load_location_provider(table_location="table_location", table_properties=EMPTY_DICT) + provider = load_location_provider(table_location="table_location", table_properties={"write.object-storage.enabled": "false"}) assert provider.new_data_location("my_file") == "table_location/data/my_file" @@ -66,7 +66,7 @@ def test_custom_location_provider_not_found() -> None: def test_object_storage_injects_entropy() -> None: - provider = load_location_provider(table_location="table_location", table_properties={"write.object-storage.enabled": "true"}) + provider = load_location_provider(table_location="table_location", table_properties=EMPTY_DICT) location = provider.new_data_location("test.parquet") parts = location.split("/") @@ -104,7 +104,6 @@ def test_object_storage_partitioned_paths_disabled(partition_key: Optional[Parti provider = load_location_provider( table_location="table_location", table_properties={ - "write.object-storage.enabled": "true", "write.object-storage.partitioned-paths": "false", }, ) @@ -125,6 +124,6 @@ def test_object_storage_partitioned_paths_disabled(partition_key: Optional[Parti ], ) def test_hash_injection(data_file_name: str, expected_hash: str) -> None: - provider = load_location_provider(table_location="table_location", table_properties={"write.object-storage.enabled": "true"}) + provider = load_location_provider(table_location="table_location", table_properties=EMPTY_DICT) assert provider.new_data_location(data_file_name) == f"table_location/data/{expected_hash}/{data_file_name}"