Skip to content
Merged
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
30 changes: 19 additions & 11 deletions sdk/python/feast/infra/online_stores/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,27 @@ def update(
online_config.endpoint_url,
online_config.session_based_auth,
)
# Add Tags attribute to creation request only if configured to prevent
# TagResource permission issues, even with an empty Tags array.
kwargs = (
{
"Tags": [

online_tags = online_config.tags or {}
common_tags = [
{"Key": key, "Value": value}
for key, value in online_tags.items()
]

for table_instance in tables_to_keep:
table_tags = common_tags + (
[
{"Key": key, "Value": value}
for key, value in online_config.tags.items()
for key, value in table_instance.tags.items()
if key not in online_tags
]
}
if online_config.tags
else {}
)
for table_instance in tables_to_keep:
if table_instance.tags
else []
)

# Add Tags attribute to creation request only if configured to prevent
# TagResource permission issues, even with an empty Tags array.
kwargs = {"Tags": table_tags} if table_tags else {}
try:
dynamodb_resource.create_table(
TableName=_get_table_name(online_config, config, table_instance),
Expand Down
Loading