Skip to content

Commit 4b99ee8

Browse files
authored
Merge pull request #138 from aws-samples/bugfix/exceptions
Bugfix: exceptions
2 parents 7d96d31 + 631b6df commit 4b99ee8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

cid/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
__version__ = '0.1.7'
2+
__version__ = '0.1.8'

cid/helpers/account_map.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,10 @@ def create_account_mapping_sql(self, name) -> str:
276276
template = Template(template_str)
277277
accounts_sql = list()
278278
for account in self.accounts:
279+
acc = account.copy()
280+
account_name = acc.pop('account_name').replace("'", "''")
279281
accounts_sql.append(
280-
"ROW ('{account_id}', '{account_name}:{account_id}', '{parent_account_id}', '{account_status}', '{account_email}')".format(**account))
282+
"""ROW ('{account_id}', '{account_name}:{account_id}', '{parent_account_id}', '{account_status}', '{account_email}')""".format(account_name=account_name, **acc))
281283

282284
# Fill in TPLs
283285
columns_tpl = dict()

cid/helpers/quicksight.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ def list_data_sources(self) -> list:
389389
else:
390390
return result.get('DataSources')
391391
except self.client.exceptions.AccessDeniedException:
392-
raise
392+
logger.info('Access denied listing data sources')
393+
return list()
393394
except:
394395
return list()
395396

@@ -489,10 +490,8 @@ def describe_dataset(self, id) -> dict:
489490
self._datasets.update({_dataset.get('DataSetId'): _dataset})
490491
except self.client.exceptions.ResourceNotFoundException:
491492
logger.info(f'DataSetId {id} do not exist')
492-
raise
493493
except self.client.exceptions.AccessDeniedException:
494494
logger.debug(f'No quicksight:DescribeDataSet permission or missing DataSetId {id}')
495-
raise
496495
return self._datasets.get(id)
497496

498497
def describe_data_source(self, id):

0 commit comments

Comments
 (0)