Skip to content
Merged
Changes from all commits
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
9 changes: 8 additions & 1 deletion pyiceberg/table/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import mmh3

from pyiceberg.partitioning import PartitionKey
from pyiceberg.table import TableProperties
from pyiceberg.typedef import Properties
from pyiceberg.utils.properties import property_as_bool

Expand All @@ -46,6 +45,8 @@ def __init__(self, table_location: str, table_properties: Properties):
self.table_location = table_location
self.table_properties = table_properties

from pyiceberg.table import TableProperties

if path := table_properties.get(TableProperties.WRITE_DATA_PATH):
self.data_path = path.rstrip("/")
else:
Expand Down Expand Up @@ -85,6 +86,8 @@ class ObjectStoreLocationProvider(LocationProvider):

def __init__(self, table_location: str, table_properties: Properties):
super().__init__(table_location, table_properties)
from pyiceberg.table import TableProperties

self._include_partition_paths = property_as_bool(
self.table_properties,
TableProperties.WRITE_OBJECT_STORE_PARTITIONED_PATHS,
Expand Down Expand Up @@ -131,6 +134,8 @@ def _import_location_provider(
try:
path_parts = location_provider_impl.split(".")
if len(path_parts) < 2:
from pyiceberg.table import TableProperties

raise ValueError(
f"{TableProperties.WRITE_PY_LOCATION_PROVIDER_IMPL} should be full path (module.CustomLocationProvider), got: {location_provider_impl}"
)
Expand All @@ -144,6 +149,8 @@ def _import_location_provider(


def load_location_provider(table_location: str, table_properties: Properties) -> LocationProvider:
from pyiceberg.table import TableProperties

table_location = table_location.rstrip("/")

if location_provider_impl := table_properties.get(TableProperties.WRITE_PY_LOCATION_PROVIDER_IMPL):
Expand Down