From 8bc0472fae824d42ddd7f5ab8e3bb42a823ab76f Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 6 Mar 2023 15:09:02 +0100 Subject: [PATCH] Handle null window metric (#10440) * fix: handle null window metrics * fix: remove else from try/except pattern --- .../profiler/interface/sqlalchemy/sqa_profiler_interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ingestion/src/metadata/profiler/profiler/interface/sqlalchemy/sqa_profiler_interface.py b/ingestion/src/metadata/profiler/profiler/interface/sqlalchemy/sqa_profiler_interface.py index 4abfaad1bcc..153581cac80 100644 --- a/ingestion/src/metadata/profiler/profiler/interface/sqlalchemy/sqa_profiler_interface.py +++ b/ingestion/src/metadata/profiler/profiler/interface/sqlalchemy/sqa_profiler_interface.py @@ -253,7 +253,6 @@ class SQAProfilerInterface(ProfilerProtocol, SQAInterfaceMixin): row = runner.select_first_from_sample( *[metric(column).fn() for metric in metrics] ) - return dict(row) except Exception as exc: logger.debug(traceback.format_exc()) logger.warning( @@ -261,6 +260,9 @@ class SQAProfilerInterface(ProfilerProtocol, SQAInterfaceMixin): ) session.rollback() raise RuntimeError(exc) + if row: + return dict(row) + return None @_get_metrics.register(MetricTypes.System.value) def _(