Skip to content
Open
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: 4 additions & 5 deletions pyiceberg/catalog/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,10 @@ def _get_update_database_item(namespace_item: dict[str, Any], updated_properties


def _get_namespace_properties(namespace_dict: dict[str, str]) -> Properties:
return {_remove_property_prefix(key): val for key, val in namespace_dict.items() if key.startswith(PROPERTY_KEY_PREFIX)}
# removeprefix removes the literal prefix, unlike lstrip which removes any leading prefix characters
return {
key.removeprefix(PROPERTY_KEY_PREFIX): val for key, val in namespace_dict.items() if key.startswith(PROPERTY_KEY_PREFIX)
}


def _convert_dynamo_item_to_regular_dict(dynamo_json: dict[str, Any]) -> dict[str, str]:
Expand Down Expand Up @@ -888,7 +891,3 @@ def _convert_dynamo_item_to_regular_dict(dynamo_json: dict[str, Any]) -> dict[st

def _add_property_prefix(prop: str) -> str:
return PROPERTY_KEY_PREFIX + prop


def _remove_property_prefix(prop: str) -> str:
return prop.lstrip(PROPERTY_KEY_PREFIX)