Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class TableProperties:
WRITE_PY_LOCATION_PROVIDER_IMPL = "write.py-location-provider.impl"

OBJECT_STORE_ENABLED = "write.object-storage.enabled"
OBJECT_STORE_ENABLED_DEFAULT = True
OBJECT_STORE_ENABLED_DEFAULT = False

WRITE_OBJECT_STORE_PARTITIONED_PATHS = "write.object-storage.partitioned-paths"
WRITE_OBJECT_STORE_PARTITIONED_PATHS_DEFAULT = True
Expand Down
10 changes: 7 additions & 3 deletions tests/table/test_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_custom_location_provider_not_found(caplog: Any) -> None:


def test_object_storage_no_partition() -> 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": "true"})

location = provider.new_data_location("test.parquet")
parts = location.split("/")
Expand Down Expand Up @@ -111,6 +111,7 @@ 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",
},
)
Expand All @@ -131,15 +132,18 @@ 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=EMPTY_DICT)
provider = load_location_provider(table_location="table_location", table_properties={"write.object-storage.enabled": "true"})

assert provider.new_data_location(data_file_name) == f"table_location/data/{expected_hash}/{data_file_name}"


def test_object_location_provider_write_data_path() -> None:
provider = load_location_provider(
table_location="s3://table-location/table",
table_properties={TableProperties.WRITE_DATA_PATH: "s3://table-location/custom/data/path"},
table_properties={
"write.object-storage.enabled": "true",
TableProperties.WRITE_DATA_PATH: "s3://table-location/custom/data/path",
},
)

assert (
Expand Down