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

[BUGFIX] Raise error when ExpectColumnValuesToBeBetween is run against an unsupported column #10995

Conversation

joshua-stauffer
Copy link
Member

We enforce that max_value and min_value for ExpectColumnValuesToBeBetween must be a numeric or datetime type, but we don't check the underlying data. In SQL contexts where the underlying data is something else such as VARCHAR, users receive opaque exceptions generated by their database, and it isn't clear what they should do to resolve the error. Worse, because of how we bundle metric computations into a single SQL query, every expectation computed in the same run will likely fail with the same opaque error.

This PR updates the ColumnValuesBetween metric to make a basic check against the column type prior to building the query.

Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 561745c
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/67c754133b8b0300087a96cc
😎 Deploy Preview https://deploy-preview-10995.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.

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.88%. Comparing base (134962a) to head (561745c).
Report is 2 commits behind head on develop.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #10995   +/-   ##
========================================
  Coverage    80.88%   80.88%           
========================================
  Files          484      484           
  Lines        40900    40911   +11     
========================================
+ Hits         33081    33092   +11     
  Misses        7819     7819           
Flag Coverage Δ
3.10 70.30% <72.72%> (+0.01%) ⬆️
3.11 70.30% <72.72%> (+0.01%) ⬆️
3.12 70.28% <72.72%> (-0.02%) ⬇️
3.12 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.79% <100.00%> (+0.02%) ⬆️
3.12 aws_deps 46.60% <18.18%> (-0.01%) ⬇️
3.12 big 55.02% <18.18%> (-0.01%) ⬇️
3.12 bigquery 49.17% <100.00%> (+0.14%) ⬆️
3.12 databricks 50.80% <100.00%> (+0.02%) ⬆️
3.12 filesystem 63.14% <18.18%> (-0.02%) ⬇️
3.12 mssql 51.87% <100.00%> (+0.14%) ⬆️
3.12 mysql 52.12% <100.00%> (+0.14%) ⬆️
3.12 postgresql 54.78% <100.00%> (+0.01%) ⬆️
3.12 snowflake 51.57% <100.00%> (+0.02%) ⬆️
3.12 spark 58.05% <100.00%> (+0.01%) ⬆️
3.12 spark_connect 46.93% <18.18%> (-0.01%) ⬇️
3.12 trino 52.54% <100.00%> (+0.01%) ⬆️
3.9 70.32% <72.72%> (+<0.01%) ⬆️
3.9 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.79% <100.00%> (+0.02%) ⬆️
3.9 aws_deps 46.62% <18.18%> (-0.01%) ⬇️
3.9 big 55.03% <18.18%> (-0.01%) ⬇️
3.9 bigquery 49.16% <100.00%> (+0.14%) ⬆️
3.9 clickhouse 43.52% <18.18%> (-0.01%) ⬇️
3.9 databricks 50.80% <100.00%> (+0.02%) ⬆️
3.9 filesystem 63.14% <18.18%> (-0.02%) ⬇️
3.9 mssql 51.85% <100.00%> (+0.15%) ⬆️
3.9 mysql 52.10% <100.00%> (+0.15%) ⬆️
3.9 postgresql 54.76% <100.00%> (+0.01%) ⬆️
3.9 snowflake 51.57% <100.00%> (+0.02%) ⬆️
3.9 spark 58.01% <100.00%> (+0.01%) ⬆️
3.9 spark_connect 46.94% <18.18%> (-0.01%) ⬇️
3.9 trino 52.52% <100.00%> (+0.01%) ⬆️
cloud 0.00% <0.00%> (ø)
docs-basic 54.08% <72.72%> (+<0.01%) ⬆️
docs-creds-needed 52.96% <72.72%> (+<0.01%) ⬆️
docs-spark 52.50% <18.18%> (-0.01%) ⬇️

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.

Copy link
Member

@josectobar josectobar left a comment

Choose a reason for hiding this comment

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

Looks great!

@joshua-stauffer joshua-stauffer added this pull request to the merge queue Mar 4, 2025
Merged via the queue into develop with commit fbd47e4 Mar 4, 2025
72 checks passed
@joshua-stauffer joshua-stauffer deleted the m/gx-306/check_python_types_before_generating_min_max_sql branch March 4, 2025 21:20
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.

2 participants