Handle null window metric (#10440)

* fix: handle null window metrics

* fix: remove else from try/except pattern
This commit is contained in:
Teddy 2023-03-06 15:09:02 +01:00 committed by GitHub
parent ef1812a09d
commit 8bc0472fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 _(