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

[MAINTENANCE] DX-565 remove allow_cross_type_comparison from column_pair_values.a_greater_than_b #8025

Merged
merged 12 commits into from Jun 23, 2023

Conversation

TrangPham
Copy link
Contributor

Fixes #6834

Metric column_pair_values.a_greater_than_b does not accept the allow_cross_type_comparison kwarg, but it was still listed on the expectation docstring.

  • Description of PR changes above includes a link to an existing GitHub issue

  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]

  • Code is linted

    black .
    
    ruff . --fix
    
  • Appropriate tests and docs have been updated

For more details, see our Contribution Checklist, Coding style guide, and Documentation style guide.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

@netlify
Copy link

netlify bot commented May 30, 2023

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 950a095
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/6495eae3c77f05000851ed71
😎 Deploy Preview https://deploy-preview-8025--niobium-lead-7998.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@TrangPham TrangPham requested a review from a team May 30, 2023 17:54
@github-actions github-actions bot added the core label May 30, 2023
@ghost
Copy link

ghost commented May 30, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Member

@anthonyburdi anthonyburdi left a comment

Choose a reason for hiding this comment

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

Thank you! 🙇

Copy link
Contributor

@alexsherstinsky alexsherstinsky left a comment

Choose a reason for hiding this comment

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

@TrangPham & @anthonyburdi Please bear with me for a moment. This may not be enough. Thanks.

@alexsherstinsky
Copy link
Contributor

alexsherstinsky commented May 30, 2023

@TrangPham @anthonyburdi -- right now, the following modules in the V3 and higher versions of GX OSS (including ones in the "expectations", "metrics", and "tests" subdirectories) deal with the allow_cross_type_comparisons directive in one way or another:

great_expectations/core/expectation_configuration.py
great_expectations/expectations/core/expect_column_pair_values_a_to_be_greater_than_b.py
great_expectations/expectations/core/expect_column_values_to_be_between.py
great_expectations/expectations/metrics/column_map_metrics/column_values_between.py
great_expectations/expectations/metrics/column_pair_map_metrics/column_pair_values_greater.py
great_expectations/jupyter_ux/expectation_explorer.py
great_expectations/self_check/util.py

Is what is being proposed in the present pull request the most optimal handling of the deprecation of allow_cross_type_comparisons? It seems that we should look at at least one additional expectation and possibly elsewhere as well.

Thank you.

@TrangPham
Copy link
Contributor Author

great_expectations/core/expectation_configuration.py
great_expectations/expectations/core/expect_column_pair_values_a_to_be_greater_than_b.py
great_expectations/expectations/core/expect_column_values_to_be_between.py
great_expectations/expectations/metrics/column_map_metrics/column_values_between.py
great_expectations/expectations/metrics/column_pair_map_metrics/column_pair_values_greater.py
great_expectations/jupyter_ux/expectation_explorer.py
great_expectations/self_check/util.py

expect_column_values_to_be_between allows allow_cross_type_comparison to be passed in. I have removed more references to allow_cross_type_comparison for expect_column_pair_values_a_to_be_greater_than_b

@TrangPham
Copy link
Contributor Author

@alexsherstinsky Brought up some good questions in relation to this change:

  • Should we be deprecating allow_cross_type_comparison in one place but not others?
  • allow_cross_type_comparison was originally implemented to handle string date to date comparisons, what is the new way of doing this if we are deprecating this option?

cc: @talagluck

@TrangPham
Copy link
Contributor Author

@alexsherstinsky Here's the note from the changelog in 0.13.0

* BREAKING: The new Modular Expectations API will begin removing the ``parse_strings_as_datetimes`` and ``allow_cross_type_comparisons`` flags in expectations. Expectation Suites that use the flags will need to be updated to use the new Modular Expectations. In general, simply removing the flag will produce correct behavior; if you still want the exact same semantics, you should ensure your raw data already has typed datetime objects.

It seems that we should be removing and deprecating these params from all places.
This was from @jcampbell 3 years ago.

I think we can merge this and do a followup PR for removing the params from expect_column_values_to_be_between

@jcampbell
Copy link
Member

@alexsherstinsky Here's the note from the changelog in 0.13.0

* BREAKING: The new Modular Expectations API will begin removing the ``parse_strings_as_datetimes`` and ``allow_cross_type_comparisons`` flags in expectations. Expectation Suites that use the flags will need to be updated to use the new Modular Expectations. In general, simply removing the flag will produce correct behavior; if you still want the exact same semantics, you should ensure your raw data already has typed datetime objects.

It seems that we should be removing and deprecating these params from all places. This was from @jcampbell 3 years ago.

I think we can merge this and do a followup PR for removing the params from expect_column_values_to_be_between

Confirming that removing those makes sense to me!

@alexsherstinsky
Copy link
Contributor

@alexsherstinsky Here's the note from the changelog in 0.13.0

* BREAKING: The new Modular Expectations API will begin removing the ``parse_strings_as_datetimes`` and ``allow_cross_type_comparisons`` flags in expectations. Expectation Suites that use the flags will need to be updated to use the new Modular Expectations. In general, simply removing the flag will produce correct behavior; if you still want the exact same semantics, you should ensure your raw data already has typed datetime objects.

It seems that we should be removing and deprecating these params from all places. This was from @jcampbell 3 years ago.
I think we can merge this and do a followup PR for removing the params from expect_column_values_to_be_between

Confirming that removing those makes sense to me!

Then we should do it "wholesale codebase-wide" in a single pull-request (this way this change will be clear and revertible). Thanks!

@TrangPham
Copy link
Contributor Author

@jcampbell @alexsherstinsky I also removed it from expect_column_values_to_be_between. Please let me know if it needs to be further removed

@TrangPham
Copy link
Contributor Author

@jcampbell @alexsherstinsky I fixed the tests. Can you re-review? Thanks!

Copy link
Member

@jcampbell jcampbell left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@alexsherstinsky alexsherstinsky left a comment

Choose a reason for hiding this comment

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

LGTM!

@TrangPham TrangPham enabled auto-merge (squash) June 23, 2023 18:56
@TrangPham TrangPham merged commit b914b62 into develop Jun 23, 2023
45 checks passed
@TrangPham TrangPham deleted the DX-565-update-docs-for-allow-cross-type-comparisons branch June 23, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants