Minor: None query res check on table metrics (#16334)

* fix: None query res check on table metrics

* style: ran python linting
This commit is contained in:
Teddy 2024-05-20 19:52:21 +02:00 committed by GitHub
parent 5da85798c6
commit 4de6fae26e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
):