Skip to content

Skip check evaluation if columns or filter cannot be resolved in the input DataFrame#609

Merged
mwojtyczka merged 26 commits into
mainfrom
skip_invalid_checks
Oct 15, 2025
Merged

Skip check evaluation if columns or filter cannot be resolved in the input DataFrame#609
mwojtyczka merged 26 commits into
mainfrom
skip_invalid_checks

Conversation

@mwojtyczka

@mwojtyczka mwojtyczka commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Changes

Currently, applying a check to a column or list of columns that are invalid (not present in the input DataFrame or containing an unresolvable expression) would cause the check to fail. With this change, the column, columns, and filter fields are validated against the input DataFrame. If any of these fields are invalid, the check is skipped, and the results include a failure message identifying the invalid fields. This ensures that the data quality process can continue gracefully, without failing due to missing or invalid fields.

Linked issues

Resolves #608

Tests

  • manually tested
  • added unit tests
  • added integration tests
  • added end-to-end tests
  • added performance tests

@mwojtyczka mwojtyczka marked this pull request as ready for review October 11, 2025 08:33
@mwojtyczka mwojtyczka requested a review from a team as a code owner October 11, 2025 08:33
@mwojtyczka mwojtyczka requested review from tombonfert and removed request for a team October 11, 2025 08:33
@mwojtyczka mwojtyczka changed the title Skip checks if invalid columns are provided Skip checks if columns are not present in the input DataFrame Oct 11, 2025
@github-actions

github-actions Bot commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

✅ 400/400 passed, 6 flaky, 1 skipped, 4h31m51s total

Flaky tests:

  • 🤪 test_compare_datasets_check_missing_ref_df_key (10.014s)
  • 🤪 test_foreign_key_check_yaml (10.014s)
  • 🤪 test_quality_checker_workflow_streaming (2.669s)
  • 🤪 test_e2e_workflow (11m17.284s)
  • 🤪 test_quality_checker_workflow_for_patterns (2.546s)
  • 🤪 test_e2e_workflow_for_patterns_table_checks_storage (8m27.478s)

Running from acceptance #2794

Comment thread src/databricks/labs/dqx/manager.py Outdated
Comment on lines +75 to +79
if self.check.column is not None and self._is_invalid_column(self.check.column):
invalid_cols.append(get_column_name_or_alias(self.check.column))

# Validate multiple columns
if self.check.columns is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have

if
...
elif
....

?

We shouldn't have both check.column and check.columns at the same time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment thread src/databricks/labs/dqx/manager.py Outdated
"""
Returns a boolean indicating whether any of the specified check columns are invalid in the input DataFrame.
"""
return len(self.invalid_columns) > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be expressed as return bool(self.invalid_columns)...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@alexott alexott requested a review from Copilot October 14, 2025 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/databricks/labs/dqx/manager.py Outdated
Comment thread src/databricks/labs/dqx/manager.py Outdated

@ghanse ghanse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a comment on the docs.

Comment thread docs/dqx/docs/guide/quality_checks_storage.mdx Outdated
@mwojtyczka mwojtyczka mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Skips checks if columns are not present in the input dataset

4 participants