From 571b45ac5277a384061a683b653dd757cde5f06a Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Fri, 13 May 2022 21:37:25 +0530 Subject: [PATCH] Filter patterns fixed (#4939) --- ingestion/src/metadata/ingestion/source/looker.py | 4 ++-- ingestion/src/metadata/ingestion/source/powerbi.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/looker.py b/ingestion/src/metadata/ingestion/source/looker.py index 9c51f407a22..4b29836b1f0 100644 --- a/ingestion/src/metadata/ingestion/source/looker.py +++ b/ingestion/src/metadata/ingestion/source/looker.py @@ -96,7 +96,7 @@ class LookerSource(Source[Entity]): yield from self._get_looker_dashboards() def _get_dashboard_elements(self, dashboard_elements): - if not filter_by_chart( + if filter_by_chart( chart_filter_pattern=self.source_config.chartFilterPattern, chart_name=dashboard_elements.id, ): @@ -121,7 +121,7 @@ class LookerSource(Source[Entity]): all_dashboards = self.client.all_dashboards(fields="id") for child_dashboard in all_dashboards: try: - if not filter_by_dashboard( + if filter_by_dashboard( dashboard_filter_pattern=self.source_config.dashboardFilterPattern, dashboard_name=child_dashboard.id, ): diff --git a/ingestion/src/metadata/ingestion/source/powerbi.py b/ingestion/src/metadata/ingestion/source/powerbi.py index b8c999f50a2..9c9abce13a1 100644 --- a/ingestion/src/metadata/ingestion/source/powerbi.py +++ b/ingestion/src/metadata/ingestion/source/powerbi.py @@ -107,7 +107,7 @@ class PowerbiSource(Source[Entity]): """ for chart in charts: try: - if not filter_by_chart( + if filter_by_chart( self.source_config.chartFilterPattern, chart["title"] ): self.status.failure( @@ -130,7 +130,7 @@ class PowerbiSource(Source[Entity]): except Exception as err: # pylint: disable=broad-except logger.debug(traceback.format_exc()) logger.error(repr(err)) - self.status.failure(chart["title"], err) + self.status.failure(chart["title"], repr(err)) def get_dashboards(self): """Get dashboard method""" @@ -140,7 +140,7 @@ class PowerbiSource(Source[Entity]): try: dashboard_details = dashboard_service.get_dashboard(dashboard_id["id"]) self.charts = [] - if not filter_by_dashboard( + if filter_by_dashboard( self.source_config.dashboardFilterPattern, dashboard_details["displayName"], ): @@ -167,7 +167,7 @@ class PowerbiSource(Source[Entity]): except Exception as err: logger.debug(traceback.format_exc()) logger.error(err) - self.status.failure(dashboard_details["displayName"], err) + self.status.failure(dashboard_details["displayName"], repr(err)) def get_status(self) -> SourceStatus: return self.status