From acc7d453d16bf126651ffee3542cd41b61a42405 Mon Sep 17 00:00:00 2001 From: Mayuri N Date: Mon, 18 Jul 2022 14:46:58 +0530 Subject: [PATCH] fix(ingest): extract usage for dashboards allowed by pattern --- metadata-ingestion/src/datahub/ingestion/source/looker.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/looker.py b/metadata-ingestion/src/datahub/ingestion/source/looker.py index f31b22aca1e7b..6a45f257ce564 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/looker.py +++ b/metadata-ingestion/src/datahub/ingestion/source/looker.py @@ -1025,11 +1025,17 @@ def extract_usage_history_from_system_activity( self, dashboard_ids: List[str] ) -> Iterable[MetadataChangeProposalWrapper]: + dashboard_ids_allowed = [ + dashboard_id + for dashboard_id in dashboard_ids + if self.source_config.dashboard_pattern.allowed(dashboard_id) + ] + # key tuple (dashboard_id, date) dashboard_usages: Dict[tuple, DashboardUsageStatisticsClass] = dict() common_filters = { - "history.dashboard_id": ",".join(dashboard_ids), + "history.dashboard_id": ",".join(dashboard_ids_allowed), "history.created_date": self.source_config.extract_usage_history_for_interval, } for query in usage_queries.values():