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] ExpectationSuite API cleanup #9875

Merged
merged 8 commits into from
May 3, 2024
Merged

Conversation

cdkini
Copy link
Member

@cdkini cdkini commented May 3, 2024

Delete any extraneous methods we don't need (citations, filtering, etc). Also, make any methods private if we can.

  • 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 - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

For more information about contributing, see Contribute.

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!

Copy link

netlify bot commented May 3, 2024

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit e1dbe0c
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/6635003adaa9d70008ab4b1b
😎 Deploy Preview https://deploy-preview-9875.docs.greatexpectations.io
📱 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 configuration.

Comment on lines +383 to +389
assert all(
mine.isEquivalentTo(theirs)
for (mine, theirs) in zip(
single_expectation_suite.expectation_configurations,
different_suite.expectation_configurations,
)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Took the guts of the isEquivalentTo method and used it for the assertion here

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 78.61%. Comparing base (0acf99e) to head (e1dbe0c).

Files Patch % Lines
...reat_expectations/render/renderer/page_renderer.py 77.27% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9875      +/-   ##
===========================================
- Coverage    78.63%   78.61%   -0.03%     
===========================================
  Files          484      484              
  Lines        42537    42394     -143     
===========================================
- Hits         33450    33329     -121     
+ Misses        9087     9065      -22     
Flag Coverage Δ
3.10 64.46% <19.23%> (-0.05%) ⬇️
3.11 64.46% <19.23%> (-0.05%) ⬇️
3.11 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 54.01% <76.92%> (+0.11%) ⬆️
3.11 aws_deps 44.94% <15.38%> (+0.08%) ⬆️
3.11 big 56.10% <76.92%> (+0.12%) ⬆️
3.11 databricks 46.10% <19.23%> (+0.09%) ⬆️
3.11 filesystem 61.32% <80.76%> (+0.11%) ⬆️
3.11 mssql 48.98% <19.23%> (+0.10%) ⬆️
3.11 mysql 49.04% <19.23%> (+0.10%) ⬆️
3.11 postgresql 52.90% <19.23%> (+0.11%) ⬆️
3.11 snowflake 46.73% <19.23%> (+0.09%) ⬆️
3.11 spark 57.19% <19.23%> (+0.13%) ⬆️
3.11 trino 50.90% <19.23%> (+0.11%) ⬆️
3.8 64.49% <19.23%> (-0.05%) ⬇️
3.8 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 54.02% <76.92%> (+0.11%) ⬆️
3.8 aws_deps 44.96% <15.38%> (+0.09%) ⬆️
3.8 big 56.12% <76.92%> (+0.12%) ⬆️
3.8 databricks 46.11% <19.23%> (+0.09%) ⬆️
3.8 filesystem 61.33% <80.76%> (+0.11%) ⬆️
3.8 mssql 48.96% <19.23%> (+0.10%) ⬆️
3.8 mysql 49.02% <19.23%> (+0.10%) ⬆️
3.8 postgresql 52.89% <19.23%> (+0.11%) ⬆️
3.8 snowflake 46.75% <19.23%> (+0.09%) ⬆️
3.8 spark 57.15% <19.23%> (+0.13%) ⬆️
3.8 trino 50.88% <19.23%> (+0.11%) ⬆️
3.9 64.48% <19.23%> (-0.05%) ⬇️
cloud 0.00% <0.00%> (ø)
docs-basic 49.11% <19.23%> (+0.10%) ⬆️
docs-creds-needed 50.23% <73.07%> (+0.10%) ⬆️
docs-spark 48.32% <19.23%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

return removed_expectations

def find_expectation_indexes(
def _find_expectation_indexes(
Copy link
Member Author

Choose a reason for hiding this comment

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

This is used by other methods so it has to stay around but I don't think it needs to be public

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we're misusing this. This method isn't private; it's deprecated. And it's already not in the public api. typing-extensions has a deprecated decorator. Thoughts on just using that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose I care less about the distinction if the only external use case is in a test

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to close the loop on this, this method is only ever used within this class (at least after the other deletions in this file).

@cdkini cdkini self-assigned this May 3, 2024
Copy link
Contributor

@tyler-hoffman tyler-hoffman left a comment

Choose a reason for hiding this comment

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

I want to at least discuss not using the psuedo-private _ prefix for methods that are used outside of the class.

self.meta["citations"].append(citation)

# noinspection PyPep8Naming
def isEquivalentTo(self, other):
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought this one was too hard to pull out? Awesome if we can do it now!

return removed_expectations

def find_expectation_indexes(
def _find_expectation_indexes(
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we're misusing this. This method isn't private; it's deprecated. And it's already not in the public api. typing-extensions has a deprecated decorator. Thoughts on just using that?

@cdkini cdkini enabled auto-merge May 3, 2024 14:55
@cdkini cdkini added this pull request to the merge queue May 3, 2024
Merged via the queue into develop with commit 9b525ca May 3, 2024
68 checks passed
@cdkini cdkini deleted the m/v1-74/suite_cleanup branch May 3, 2024 15:52
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.

None yet

2 participants