Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions cid/helpers/cur.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,18 @@ def set_cur(self, database: str=None, table: str=None):
def find_cur(self, database: str=None, table: str=None):
"""Choose CUR"""
metadata = None
cur_database = database or get_parameters().get('cur-database') or self.athena.DatabaseName
cur_database = database or get_parameters().get('cur-database')
if not table and get_parameters().get('cur-table-name') and ',' not in str(get_parameters().get('cur-table-name')):
table = get_parameters().get('cur-table-name')
if table: # Table sepcified explicity, so no need to scan. Just need to make sure the table exists
if table: # Table specified explicitly, so no need to scan. Just need to make sure the table exists
try:
metadata = self.athena.get_table_metadata(table, cur_database)
metadata = self.athena.get_table_metadata(table, cur_database or self.athena.DatabaseName)
except self.athena.client.exceptions.MetadataException as exc:
logger.debug(f'Provided cur-table-name "{table}" in database "{cur_database}" is not found. ({exc})')
raise CidCritical(f'Provided cur-table-name "{table}" in database "{cur_database}" is not found. Please make sure the table exists. This could also indicate a LakeFormation permission issue, see our FAQ for help.')
logger.debug(f'Provided cur-table-name "{table}" in database "{cur_database or self.athena.DatabaseName}" is not found. ({exc})')
raise CidCritical(f'Provided cur-table-name "{table}" in database "{cur_database or self.athena.DatabaseName}" is not found. Please make sure the table exists. This could also indicate a LakeFormation permission issue, see our FAQ for help.')
res, message = self.table_is_cur(table=metadata, return_reason=True)
if not res:
raise CidCritical(f'Provided cur-table-name "{table}" in database "{cur_database}" is not cur. {message}')
raise CidCritical(f'Provided cur-table-name "{table}" in database "{cur_database or self.athena.DatabaseName}" is not cur. {message}')
return cur_database, metadata

all_cur_tables = []
Expand Down
4 changes: 3 additions & 1 deletion cid/test/bats/10-deploy-update-delete/cudos.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cur_table="${cur_table:-cur1}" # If variable not set or null, use default. FIXME
--dashboard-id cudos-v5 \
--athena-database $database_name\
--account-map-source dummy \
--cur-database $database_name \
--cur-table-name $cur_table \
--athena-workgroup primary\
--quicksight-user $quicksight_user \
Expand Down Expand Up @@ -60,6 +61,7 @@ cur_table="${cur_table:-cur1}" # If variable not set or null, use default. FIXME
@test "Update works" {
run cid-cmd -vv --yes update --force --recursive \
--dashboard-id cudos-v5 \
--cur-database $database_name \
--cur-table-name $cur_table \
--athena-database $database_name\
--athena-workgroup primary\
Expand Down Expand Up @@ -105,4 +107,4 @@ cur_table="${cur_table:-cur1}" # If variable not set or null, use default. FIXME
--table-name 'summary_view'

[ "$status" -ne 0 ]
}
}
Loading