mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-03 02:55:59 +00:00
fix: handle tableConfig for profiler CLI (#13437)
* fix: handle tableConfig for profiler CLI * fix: empty commit for CI
This commit is contained in:
parent
ddae3d8143
commit
c4a3de6a85
@ -59,6 +59,7 @@ VERSIONS = {
|
||||
"redshift": "sqlalchemy-redshift==0.8.12",
|
||||
"snowflake": "snowflake-sqlalchemy~=1.4",
|
||||
"elasticsearch8": "elasticsearch8~=8.9.0",
|
||||
"giturlparse": "giturlparse",
|
||||
}
|
||||
|
||||
COMMONS = {
|
||||
@ -213,7 +214,7 @@ plugins: Dict[str, Set[str]] = {
|
||||
VERSIONS["looker-sdk"],
|
||||
VERSIONS["lkml"],
|
||||
"gitpython~=3.1.34",
|
||||
"giturlparse",
|
||||
VERSIONS["giturlparse"],
|
||||
},
|
||||
"mlflow": {"mlflow-skinny>=2.3.0", "alembic~=1.10.2"},
|
||||
"mongo": {VERSIONS["mongo"], VERSIONS["pandas"]},
|
||||
@ -297,6 +298,7 @@ test = {
|
||||
VERSIONS["redshift"],
|
||||
VERSIONS["snowflake"],
|
||||
VERSIONS["elasticsearch8"],
|
||||
VERSIONS["giturlparse"],
|
||||
}
|
||||
|
||||
e2e_test = {
|
||||
|
||||
@ -16,7 +16,7 @@ from __future__ import annotations
|
||||
|
||||
import traceback
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any, Dict, Generic, List, Optional, Set, Tuple, Type
|
||||
from typing import Any, Dict, Generic, List, Optional, Set, Tuple, Type, cast
|
||||
|
||||
from pydantic import ValidationError
|
||||
from sqlalchemy import Column
|
||||
@ -238,21 +238,35 @@ class Profiler(Generic[TMetric]):
|
||||
if (
|
||||
self.profiler_interface.table_entity.tableProfilerConfig
|
||||
and self.profiler_interface.table_entity.tableProfilerConfig.includeColumns
|
||||
):
|
||||
) or (self.include_columns):
|
||||
# include_columns is set from the `tableConfig` of the `ProfilerProcessorConfig` in the CLI config
|
||||
# while `self.profiler_interface.table_entity.tableProfilerConfig.includeColumns` is set from the entity
|
||||
# definition in the metadata service. This gets set either from the UI or the profiler entity page. Config
|
||||
# ran from the CLI takes precedence over the entity definition.
|
||||
columns = (
|
||||
self.include_columns
|
||||
if self.include_columns
|
||||
else self.profiler_interface.table_entity.tableProfilerConfig.includeColumns
|
||||
)
|
||||
columns = cast(List[ColumnProfilerConfig], columns)
|
||||
metric_names = next(
|
||||
(
|
||||
include_columns.metrics
|
||||
for include_columns in self.profiler_interface.table_entity.tableProfilerConfig.includeColumns
|
||||
for include_columns in columns
|
||||
if include_columns.columnName == column.name
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
||||
if metric_names:
|
||||
metric_names = {
|
||||
mtrc.lower() for mtrc in metric_names
|
||||
} # case insensitice
|
||||
metrics = [
|
||||
Metric.value
|
||||
for Metric in Metrics
|
||||
if Metric.value.name() in metric_names and Metric.value in metrics
|
||||
if Metric.value.name().lower() in metric_names
|
||||
and Metric.value in metrics
|
||||
]
|
||||
|
||||
return [metric for metric in metrics if metric.is_col_metric()]
|
||||
|
||||
@ -416,6 +416,7 @@ export const BETA_SERVICES = [
|
||||
DashboardServiceType.QlikSense,
|
||||
DatabaseServiceType.Couchbase,
|
||||
SearchServiceType.ElasticSearch,
|
||||
DatabaseServiceType.Greenplum,
|
||||
];
|
||||
|
||||
export const TEST_CONNECTION_INITIAL_MESSAGE = i18n.t(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user