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

fix(ingest): handle exceptions in min, max, mean profiling #9129

Merged
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -406,22 +406,52 @@ def _get_dataset_rows(self, dataset_profile: DatasetProfileClass) -> None:
def _get_dataset_column_min(
self, column_profile: DatasetFieldProfileClass, column: str
) -> None:
if self.config.include_field_min_value:
if not self.config.include_field_min_value:
return
try:
column_profile.min = str(self.dataset.get_column_min(column))
except Exception as e:
logger.debug(
f"Caught exception while attempting to get column min for column {column}. {e}"
)
self.report.report_warning(
"Profiling - Unable to get column min",
f"{self.dataset_name}.{column}",
)

@_run_with_query_combiner
def _get_dataset_column_max(
self, column_profile: DatasetFieldProfileClass, column: str
) -> None:
if self.config.include_field_max_value:
if not self.config.include_field_max_value:
return
try:
column_profile.max = str(self.dataset.get_column_max(column))
except Exception as e:
logger.debug(
f"Caught exception while attempting to get column max for column {column}. {e}"
)
self.report.report_warning(
"Profiling - Unable to get column max",
f"{self.dataset_name}.{column}",
)

@_run_with_query_combiner
def _get_dataset_column_mean(
self, column_profile: DatasetFieldProfileClass, column: str
) -> None:
if self.config.include_field_mean_value:
if not self.config.include_field_mean_value:
return
try:
column_profile.mean = str(self.dataset.get_column_mean(column))
except Exception as e:
logger.debug(
f"Caught exception while attempting to get column mean for column {column}. {e}"
)
self.report.report_warning(
"Profiling - Unable to get column mean",
f"{self.dataset_name}.{column}",
)

@_run_with_query_combiner
def _get_dataset_column_median(
Expand Down
Loading