From 6489a4ffbedebdf3d37aea35df683bd64428576e Mon Sep 17 00:00:00 2001 From: Iakov Gan Date: Sat, 16 Nov 2024 17:06:46 +0100 Subject: [PATCH] cleanup --- cid/helpers/quicksight/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cid/helpers/quicksight/__init__.py b/cid/helpers/quicksight/__init__.py index 15a78c92..35dba243 100644 --- a/cid/helpers/quicksight/__init__.py +++ b/cid/helpers/quicksight/__init__.py @@ -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') @@ -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: @@ -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: