Skip to content

[MAINTENANCE] Remove dead statistical expectations and schemas#11764

Open
joshua-stauffer wants to merge 3 commits into
developfrom
maintenance/remove-dead-code-stat-expectations
Open

[MAINTENANCE] Remove dead statistical expectations and schemas#11764
joshua-stauffer wants to merge 3 commits into
developfrom
maintenance/remove-dead-code-stat-expectations

Conversation

@joshua-stauffer

Copy link
Copy Markdown
Contributor

Summary

Removes dead code identified by the dead code analyzer (AST-based reachability analysis from @public_api roots).

Removed

  • great_expectations/expectations/core/expect_column_bootstrapped_ks_test_p_value_to_be_greater_than.py
  • great_expectations/expectations/core/expect_column_chisquare_test_p_value_to_be_greater_than.py
  • great_expectations/expectations/core/expect_column_pair_cramers_phi_value_to_be_less_than.py
  • great_expectations/expectations/core/expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than.py
  • great_expectations/expectations/metrics/column_aggregate_metrics/column_bootstrapped_ks_test_p_value.py
  • great_expectations/expectations/core/schemas/ (entire directory — unused JSON schemas)
  • String references cleaned up in self_check/util.py

Verification performed

  • No @public_api decorators on removed code
  • No cross-repo imports from cloud or gx-runner
  • No __init__.py re-export references remaining
  • Not in dead_code_exceptions.json
  • String references cleaned up
  • Local lint and type-check passing

Generated with Claude Code using the dead-code-removal skill.

Removes dead statistical expectations (bootstrapped KS, chi-square, Cramers phi,
parameterized distribution KS), their metric, and the unused core/schemas/ directory.
Cleans up string references in self_check/util.py.
Copilot AI review requested due to automatic review settings April 2, 2026 18:05
@netlify

netlify Bot commented Apr 2, 2026

Copy link
Copy Markdown

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 00969ff
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/69cf71f697a67b0008bd8c36

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

Removes expectation implementations and JSON schema artifacts identified as unreachable from @public_api roots, reducing dead code and package surface area.

Changes:

  • Deleted multiple incomplete / unexported statistical Expectation classes.
  • Removed unused JSON schema definitions under great_expectations/expectations/core/schemas/.

Reviewed changes

Copilot reviewed 45 out of 59 changed files in this pull request and generated no comments.

Show a summary per file
File Description
great_expectations/expectations/core/schemas/ExpectQueryResultsToMatchComparison.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectCompoundColumnsToBeUnique.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToNotMatchRegexList.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToNotMatchRegex.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToNotMatchLikePatternList.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToNotMatchLikePattern.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToNotBeNull.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToMatchRegex.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToMatchLikePattern.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToBeUnique.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToBeNull.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValuesToBeInTypeList.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnValueLengthsToEqual.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnToExist.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnSumToBeBetween.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnStdevToBeBetween.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnPairValuesToBeEqual.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnMinToBeBetween.json Removes unused expectation JSON schema.
great_expectations/expectations/core/schemas/ExpectColumnMedianToBeBetween.json Removes unused expectation JSON schema.
great_expectations/expectations/core/expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than.py Removes incomplete / unreachable expectation class.
great_expectations/expectations/core/expect_column_pair_cramers_phi_value_to_be_less_than.py Removes incomplete / unreachable expectation class and renderers.
great_expectations/expectations/core/expect_column_chisquare_test_p_value_to_be_greater_than.py Removes incomplete / unreachable expectation class.
great_expectations/expectations/core/expect_column_bootstrapped_ks_test_p_value_to_be_greater_than.py Removes incomplete / unreachable expectation class.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.82%. Comparing base (83de99e) to head (00969ff).
⚠️ Report is 91 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11764      +/-   ##
===========================================
+ Coverage    84.59%   84.82%   +0.23%     
===========================================
  Files          473      468       -5     
  Lines        39260    39135     -125     
===========================================
- Hits         33211    33198      -13     
+ Misses        6049     5937     -112     
Flag Coverage Δ
3.10 73.69% <ø> (+0.18%) ⬆️
3.10 athena ?
3.10 aws_deps ?
3.10 big ?
3.10 clickhouse ?
3.10 filesystem ?
3.10 mysql ?
3.10 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.10 postgresql ?
3.10 spark ?
3.10 spark_connect ?
3.10 sql_server ?
3.10 trino ?
3.11 73.75% <ø> (+0.20%) ⬆️
3.11 athena ?
3.11 aws_deps ?
3.11 big ?
3.11 clickhouse ?
3.11 filesystem ?
3.11 mysql ?
3.11 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.11 postgresql ?
3.11 spark ?
3.11 spark_connect ?
3.11 sql_server ?
3.11 trino ?
3.12 73.74% <ø> (+0.18%) ⬆️
3.12 athena ?
3.12 aws_deps ?
3.12 big ?
3.12 filesystem ?
3.12 mysql ?
3.12 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.12 postgresql ?
3.12 spark ?
3.12 spark_connect ?
3.12 sql_server ?
3.12 trino ?
3.13 73.76% <ø> (+0.20%) ⬆️
3.13 athena 42.06% <ø> (+0.10%) ⬆️
3.13 aws_deps 45.32% <ø> (+0.11%) ⬆️
3.13 big 55.40% <ø> (+0.14%) ⬆️
3.13 bigquery 51.38% <ø> (+0.13%) ⬆️
3.13 clickhouse 42.07% <ø> (+0.10%) ⬆️
3.13 databricks 53.19% <ø> (+0.13%) ⬆️
3.13 filesystem 64.50% <ø> (+0.17%) ⬆️
3.13 gx-redshift 51.53% <ø> (+0.13%) ⬆️
3.13 mysql 51.93% <ø> (+0.13%) ⬆️
3.13 openpyxl or pyarrow or project or sqlite or aws_creds 60.11% <ø> (+0.15%) ⬆️
3.13 postgresql 55.34% <ø> (+0.14%) ⬆️
3.13 snowflake 54.03% <ø> (+0.13%) ⬆️
3.13 spark 56.05% <ø> (+0.14%) ⬆️
3.13 spark_connect 46.99% <ø> (+0.11%) ⬆️
3.13 sql_server 53.37% <ø> (+0.13%) ⬆️
3.13 trino 48.87% <ø> (+0.12%) ⬆️
cloud 0.00% <ø> (ø)
docs-basic 59.52% <ø> (+0.15%) ⬆️
docs-creds-needed 58.10% <ø> (+0.15%) ⬆️
docs-spark 57.57% <ø> (+0.15%) ⬆️

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NathanFarmer NathanFarmer 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.

These schemas are more of a DX tool for viewing schema changes in PRs

The schemas directory alerts developers to schema changes created by updating
Expectations (via 'invoke schemas --sync'). It was incorrectly flagged as dead
code because nothing imports it at runtime.
Copilot AI review requested due to automatic review settings April 3, 2026 07:53

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 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1134 to 1140
"expect_column_values_to_be_dateutil_parseable",
"expect_column_values_to_be_json_parseable",
"expect_column_values_to_match_json_schema",
"expect_column_stdev_to_be_between",
"expect_column_most_common_value_to_be_in_set",
"expect_column_bootstrapped_ks_test_p_value_to_be_greater_than",
"expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than",
"expect_column_pair_values_to_be_equal",
"expect_column_pair_values_a_to_be_greater_than_b",

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

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

This PR removes several expectation types from the codebase, but there are still references to these expectation type strings elsewhere (e.g., docs/docusaurus/versioned_docs/version-0.18/reference/learn/expectations/distributional_expectations.md, assets/scripts/build_gallery.py, and tests/expectations/test_expectation_atomic_renderers.py). Also, the PR description states the entire great_expectations/expectations/core/schemas/ directory was removed, but it still exists in-tree. Please either update/remove those remaining references (and delete the schemas dir if intended), or adjust the PR description/scope to match what’s actually changing.

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Is this PR still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity.

It will be closed if no further activity occurs. Thank you for your contributions 🙇

@github-actions github-actions Bot added stale Stale issues and PRs and removed stale Stale issues and PRs labels May 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Is this PR still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity.

It will be closed if no further activity occurs. Thank you for your contributions 🙇

@github-actions github-actions Bot added the stale Stale issues and PRs label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale issues and PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants