Skip to content

Commit

Permalink
fix: added fall back to table metric computation (open-metadata#14771)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyCr authored and Abhishek332 committed Jan 25, 2024
1 parent b3c538e commit 34a6d3c
Show file tree
Hide file tree
Showing 3 changed files with 466 additions and 399 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
from metadata.profiler.metrics.static.mean import Mean
from metadata.profiler.metrics.static.stddev import StdDev
from metadata.profiler.metrics.static.sum import Sum
from metadata.profiler.orm.functions.table_metric_construct import (
table_metric_construct_factory,
)
from metadata.profiler.orm.functions.table_metric_computer import TableMetricComputer
from metadata.profiler.orm.registry import Dialects
from metadata.profiler.processor.runner import QueryRunner
from metadata.utils.constants import SAMPLE_DATA_DEFAULT_COUNT
Expand Down Expand Up @@ -186,12 +184,13 @@ def _compute_table_metrics(
# pylint: disable=protected-access
try:
dialect = runner._session.get_bind().dialect.name
row = table_metric_construct_factory.construct(
table_metric_computer: TableMetricComputer = TableMetricComputer(
dialect,
runner=runner,
metrics=metrics,
conn_config=self.service_connection_config,
)
row = table_metric_computer.compute()
if row:
return dict(row)
return None
Expand Down
Loading

0 comments on commit 34a6d3c

Please sign in to comment.