Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 16, 2024
1 parent fb178f4 commit 6489a4f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cid/helpers/quicksight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,21 +585,18 @@ def discover_data_sources(self) -> None:
self.describe_data_source(d)
except Exception as exc:
logger.debug(exc, exc_info=True)

def discover_dashboards(self, refresh_overrides: List[str]=[], refresh: bool = False) -> None:
""" Discover deployed dashboards
:param refresh_overrides: a list of dashboard ids to refresh
:param refresh: force refresh all dashboards
"""

if refresh or self._dashboards is None:
self._dashboards = {}
else:
for dashboard_id in refresh_overrides:
if dashboard_id in self._dashboards:
del self._dashboards[dashboard_id]

logger.info('Discovering deployed dashboards')
deployed_dashboards=self.list_dashboards()
logger.info(f'Found {len(deployed_dashboards)} deployed dashboards')
Expand All @@ -611,9 +608,7 @@ def discover_dashboards(self, refresh_overrides: List[str]=[], refresh: bool = F
dashboard_id = dashboard.get('DashboardId')
bar.set_description(f'Discovering {dashboard_name[:10]:<10}', refresh=True)
logger.info(f'Discovering "{dashboard_name}"')

refresh = dashboard_id in refresh_overrides

self.discover_dashboard(dashboard_id, refresh=refresh)

def list_dashboards(self) -> list:
Expand Down Expand Up @@ -1266,7 +1261,7 @@ def ensure_dataset_refresh_schedule(self, dataset_id, schedules: list):
if schedule["ScheduleId"] == existing["ScheduleId"]:
existing_schedule = existing
break

# Verify that all schedule parameters are set
schedule["ScheduleId"] = schedule.get("ScheduleId", "cid")
if "ScheduleFrequency" not in schedule:
Expand Down

0 comments on commit 6489a4f

Please sign in to comment.