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

Feature: Customizable column names and extra config placeholder #127

Merged

Conversation

hrfmartins
Copy link
Contributor

In this PR I implemented a placeholder for extra configurations for DQEngine. I also included customizable column names to replace the custom names.

Changes

  • New constructor for DQEngine
  • Turned get_invalid and get_valid to static, in order to use the internal naming resolution and avoid passing references around.

Linked issues

Resolves #46

Tests

  • manually tested
  • added unit tests
  • added integration tests

@hrfmartins hrfmartins requested a review from a team as a code owner January 23, 2025 13:46
@hrfmartins hrfmartins requested review from nehamilak-db and removed request for a team January 23, 2025 13:46
@mwojtyczka
Copy link
Contributor

mwojtyczka commented Jan 23, 2025

@hrfmartins thank you for the contribution. Really appreciated. I have a few requests. Can you please sign your commits? We require all commits to be signed with GPG key. Please also run make fmt to format the code and run pylint to make sure the build works before commiting.
See more here: https://databrickslabs.github.io/dqx/docs/dev/contributing/#first-contribution

We currently have an issue with running integration tests triggered from forks. Your PR may be blocked at the moment.

@hrfmartins hrfmartins force-pushed the feature/customizable-column-names branch 7 times, most recently from dbc3dd2 to a335d2a Compare January 23, 2025 15:12
@hrfmartins
Copy link
Contributor Author

@mwojtyczka Signing with GPG done and lint + fmt ran and issues fixed :) Sorry for the inconvenience.

Is there anything I can/need to do about the fork issue? Thank you

@mwojtyczka
Copy link
Contributor

mwojtyczka commented Jan 24, 2025

@mwojtyczka Signing with GPG done and lint + fmt ran and issues fixed :) Sorry for the inconvenience.

Is there anything I can/need to do about the fork issue? Thank you

Thank you! We are working on fixing the fork issue. Will keep you posted.

@hrfmartins hrfmartins force-pushed the feature/customizable-column-names branch from ed300d9 to a09b0fe Compare February 1, 2025 11:00
@hrfmartins hrfmartins requested a review from mwojtyczka February 2, 2025 08:30
Copy link
Contributor

@mwojtyczka mwojtyczka left a comment

Choose a reason for hiding this comment

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

@hrfmartins
Can you please extend the existing guide to show how to customize the reporting columns. Perhaps a new section, sth like "Additional configuration" before the custom checks:
https://github.com/databrickslabs/dqx/blob/main/docs/dqx/docs/guide.mdx#quality-rules-and-creation-of-custom-checks

Can you please also extend demos, probably a new cell here:
https://github.com/databrickslabs/dqx/blob/main/demos/dqx_demo_library.py#L286

Copy link
Contributor

@mwojtyczka mwojtyczka left a comment

Choose a reason for hiding this comment

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

LGTM

@mwojtyczka mwojtyczka merged commit c61f6d4 into databrickslabs:main Feb 7, 2025
9 checks passed
mwojtyczka added a commit that referenced this pull request Feb 12, 2025
* Provided option to customize reporting column names ([#127](#127)). In this release, the DQEngine library has been enhanced to allow for customizable reporting column names. A new constructor has been added to DQEngine, which accepts an optional ExtraParams object for extra configurations. A new Enum class, DefaultColumnNames, has been added to represent the columns used for error and warning reporting. New tests have been added to verify the application of checks with custom column naming. These changes aim to improve the customizability, flexibility, and user experience of DQEngine by providing more control over the reporting columns and resolving issue [#46](#46).
* Fixed parsing error when loading checks from a file ([#165](#165)). In this release, we have addressed a parsing error that occurred when loading checks (data quality rules) from a file, fixing issue [#162](#162). The specific issue being resolved is a SQL expression parsing error. The changes include refactoring tests to eliminate code duplication and improve maintainability, as well as updating method and variable names to use `filepath` instead of "path". Additionally, new unit and integration tests have been added and manually tested to ensure the correct functionality of the updated code.
* Removed usage of try_cast spark function from the checks to make sure DQX can be run on more runtimes ([#163](#163)). In this release, we have refactored the code to remove the usage of the `try_cast` Spark function and replace it with `cast` and `isNull` checks to improve code compatibility, particularly for runtimes where `try_cast` is not available. The affected functionality includes null and empty column checks, checking if a column value is in a list, and checking if a column value is a valid date or timestamp. We have added unit and integration tests to ensure functionality is working as intended.
* Added filter to rules so that you can make conditional checks ([#141](#141)). The filter serves as a condition that data must meet to be evaluated by the check function. The filters restrict the evaluation of checks to only apply to rows that meet the specified conditions. This feature enhances the flexibility and customizability of data quality checks in the DQEngine.
@mwojtyczka mwojtyczka mentioned this pull request Feb 12, 2025
mwojtyczka added a commit that referenced this pull request Feb 12, 2025
* Provided option to customize reporting column names
([#127](#127)). In this
release, the DQEngine library has been enhanced to allow for
customizable reporting column names. A new constructor has been added to
DQEngine, which accepts an optional ExtraParams object for extra
configurations. A new Enum class, DefaultColumnNames, has been added to
represent the columns used for error and warning reporting. New tests
have been added to verify the application of checks with custom column
naming. These changes aim to improve the customizability, flexibility,
and user experience of DQEngine by providing more control over the
reporting columns and resolving issue
[#46](#46).
* Fixed parsing error when loading checks from a file
([#165](#165)). In this
release, we have addressed a parsing error that occurred when loading
checks (data quality rules) from a file, fixing issue
[#162](#162). The specific
issue being resolved is a SQL expression parsing error. The changes
include refactoring tests to eliminate code duplication and improve
maintainability, as well as updating method and variable names to use
`filepath` instead of "path". Additionally, new unit and integration
tests have been added and manually tested to ensure the correct
functionality of the updated code.
* Removed usage of try_cast spark function from the checks to make sure
DQX can be run on more runtimes
([#163](#163)). In this
release, we have refactored the code to remove the usage of the
`try_cast` Spark function and replace it with `cast` and `isNull` checks
to improve code compatibility, particularly for runtimes where
`try_cast` is not available. The affected functionality includes null
and empty column checks, checking if a column value is in a list, and
checking if a column value is a valid date or timestamp. We have added
unit and integration tests to ensure functionality is working as
intended.
* Added filter to rules so that you can make conditional checks
([#141](#141)). The filter
serves as a condition that data must meet to be evaluated by the check
function. The filters restrict the evaluation of checks to only apply to
rows that meet the specified conditions. This feature enhances the
flexibility and customizability of data quality checks in the DQEngine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Make error and warning column names configurable
2 participants