Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest): run profiler in more cardinality cases #6397

Merged
merged 7 commits into from
Dec 7, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 14 additions & 28 deletions metadata-ingestion/src/datahub/ingestion/source/ge_data_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,39 +558,25 @@ def generate_dataset_profile( # noqa: C901 (complexity)
or type_ == ProfilerDataType.FLOAT
or type_ == ProfilerDataType.NUMERIC
):
if cardinality == Cardinality.UNIQUE:
pass
elif cardinality in [
self._get_dataset_column_min(column_profile, column)
self._get_dataset_column_max(column_profile, column)
self._get_dataset_column_mean(column_profile, column)
self._get_dataset_column_median(column_profile, column)
self._get_dataset_column_stdev(column_profile, column)

self._get_dataset_column_quantiles(column_profile, column)
self._get_dataset_column_histogram(column_profile, column)

if cardinality in [
Cardinality.ONE,
Cardinality.TWO,
Cardinality.VERY_FEW,
Cardinality.FEW,
Cardinality.MANY,
Cardinality.VERY_MANY,
Cardinality.UNIQUE,
]:
self._get_dataset_column_min(column_profile, column)
self._get_dataset_column_max(column_profile, column)
self._get_dataset_column_mean(column_profile, column)
self._get_dataset_column_median(column_profile, column)

if type_ == ProfilerDataType.INT:
self._get_dataset_column_stdev(column_profile, column)

self._get_dataset_column_quantiles(column_profile, column)
self._get_dataset_column_histogram(column_profile, column)
if cardinality in [
Cardinality.ONE,
Cardinality.TWO,
Cardinality.VERY_FEW,
Cardinality.FEW,
]:
self._get_dataset_column_distinct_value_frequencies(
column_profile,
column,
)
else: # unknown cardinality - skip
pass
self._get_dataset_column_distinct_value_frequencies(
column_profile,
column,
)

elif type_ == ProfilerDataType.STRING:
if cardinality in [
Expand Down