diff --git a/ingestion/src/metadata/profiler/orm/functions/table_metric_computer.py b/ingestion/src/metadata/profiler/orm/functions/table_metric_computer.py index 10de8698a31..30df9b03c17 100644 --- a/ingestion/src/metadata/profiler/orm/functions/table_metric_computer.py +++ b/ingestion/src/metadata/profiler/orm/functions/table_metric_computer.py @@ -231,6 +231,8 @@ class OracleTableMetricComputer(BaseTableMetricComputer): ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ): @@ -260,6 +262,8 @@ class ClickHouseTableMetricComputer(BaseTableMetricComputer): ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ): @@ -306,6 +310,8 @@ class BigQueryTableMetricComputer(BaseTableMetricComputer): ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ): @@ -337,6 +343,8 @@ class BigQueryTableMetricComputer(BaseTableMetricComputer): where_clause, ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ): @@ -366,6 +374,8 @@ class MySQLTableMetricComputer(BaseTableMetricComputer): ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ): @@ -400,6 +410,8 @@ class RedshiftTableMetricComputer(BaseTableMetricComputer): columns, self._build_table("svv_table_info", "pg_catalog"), where_clause ) res = self.runner._session.execute(query).first() + if not res: + return None if res.rowCount is None or ( res.rowCount == 0 and self._entity.tableType == TableType.View ):