Skip to content

Instantly share code, notes, and snippets.

@orcaman
Created February 18, 2021 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orcaman/c5184a99b06fc776b48e147d4c483242 to your computer and use it in GitHub Desktop.
Save orcaman/c5184a99b06fc776b48e147d4c483242 to your computer and use it in GitHub Desktop.
get_composite_keys_no_cache.py
def get_composite_keys(table_name: str, with_env=True) -> list:
composite_keys = list()
desc = dynamodb_client.describe_table(TableName=table_name)
key_schema = desc['Table']['KeySchema']
for k in key_schema:
if '#' in k['AttributeName']:
composite_keys.append(k['AttributeName'])
return composite_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment