Skip to content

[MAINTENANCE] Remove dead expectation helpers and types/attributes#11765

Open
joshua-stauffer wants to merge 1 commit intodevelopfrom
maintenance/remove-dead-code-expectation-helpers
Open

[MAINTENANCE] Remove dead expectation helpers and types/attributes#11765
joshua-stauffer wants to merge 1 commit intodevelopfrom
maintenance/remove-dead-code-expectation-helpers

Conversation

@joshua-stauffer
Copy link
Copy Markdown
Member

Summary

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

Removed

  • great_expectations/expectations/regex_based_column_map_expectation.py
  • great_expectations/expectations/set_based_column_map_expectation.py
  • great_expectations/expectations/validation_handlers.py
  • great_expectations/types/attributes.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 expectation helper modules (regex_based_column_map_expectation,
set_based_column_map_expectation, validation_handlers) and the unused
types/attributes module.
Copilot AI review requested due to automatic review settings April 2, 2026 18:09
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for niobium-lead-7998 canceled.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes several expectation helper/base modules and a types helper (Attributes) that were flagged as unreachable by an AST-based dead code analyzer, and updates Sphinx public-API configuration to reflect the removals.

Changes:

  • Deleted dead expectation helper modules: regex_based_column_map_expectation.py, set_based_column_map_expectation.py, and validation_handlers.py.
  • Deleted the great_expectations.types.Attributes implementation (types/attributes.py).
  • Removed corresponding entries from Sphinx public API tracking/excludes lists.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
great_expectations/types/attributes.py Deletes the Attributes type helper.
great_expectations/expectations/validation_handlers.py Removes an unused MetaPandasDataset stub.
great_expectations/expectations/set_based_column_map_expectation.py Removes set-based column map expectation base + metric provider.
great_expectations/expectations/regex_based_column_map_expectation.py Removes regex-based column map expectation base + metric provider.
docs/sphinx_api_docs_source/public_api_missing_threshold.py Drops missing-threshold entries referencing removed functions.
docs/sphinx_api_docs_source/public_api_excludes.py Drops excludes entry referencing removed types/attributes.py.

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

Comment on lines 647 to 652
file=pathlib.Path("great_expectations/expectations/metrics/metric_provider.py"),
name="metric_value",
),
PrintableDefinition(
file=pathlib.Path(
"great_expectations/expectations/regex_based_column_map_expectation.py"
),
name="validate_configuration",
),
PrintableDefinition(
file=pathlib.Path(
"great_expectations/expectations/set_based_column_map_expectation.py"
),
name="validate_configuration",
),
PrintableDefinition(
file=pathlib.Path(
"great_expectations/experimental/metric_repository/metric_retriever.py"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The modules being deleted here (regex_based_column_map_expectation.py / set_based_column_map_expectation.py) are still imported elsewhere in-repo (e.g. multiple contrib expectations under contrib/**/expect_*.py and versioned docusaurus docs templates). Removing the files will cause ImportError for those paths and can break scripts that import contrib expectations (e.g. assets/scripts/build_gallery.py). Either update those downstream imports to the replacement API (or refactor those expectations/templates), or keep thin compatibility shims at the original import locations that re-export the new implementation (with a deprecation path).

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.15%. Comparing base (83de99e) to head (4283737).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11765      +/-   ##
===========================================
+ Coverage    84.59%   85.15%   +0.56%     
===========================================
  Files          473      469       -4     
  Lines        39260    38999     -261     
===========================================
  Hits         33211    33211              
+ Misses        6049     5788     -261     
Flag Coverage Δ
3.10 73.98% <ø> (+0.47%) ⬆️
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 74.03% <ø> (+0.47%) ⬆️
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 74.05% <ø> (+0.49%) ⬆️
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 74.05% <ø> (+0.49%) ⬆️
3.13 athena 42.24% <ø> (+0.28%) ⬆️
3.13 aws_deps 45.51% <ø> (+0.30%) ⬆️
3.13 big 55.62% <ø> (+0.36%) ⬆️
3.13 bigquery 51.60% <ø> (+0.34%) ⬆️
3.13 clickhouse 42.25% <ø> (+0.28%) ⬆️
3.13 databricks 53.41% <ø> (+0.35%) ⬆️
3.13 filesystem 64.76% <ø> (+0.43%) ⬆️
3.13 gx-redshift 51.75% <ø> (+0.34%) ⬆️
3.13 mysql 52.15% <ø> (+0.34%) ⬆️
3.13 openpyxl or pyarrow or project or sqlite or aws_creds 60.35% <ø> (+0.40%) ⬆️
3.13 postgresql 55.57% <ø> (+0.36%) ⬆️
3.13 snowflake 54.25% <ø> (+0.35%) ⬆️
3.13 spark 56.28% <ø> (+0.37%) ⬆️
3.13 spark_connect 47.19% <ø> (+0.31%) ⬆️
3.13 sql_server 53.59% <ø> (+0.35%) ⬆️
3.13 trino 49.07% <ø> (+0.32%) ⬆️
cloud 0.00% <ø> (ø)
docs-basic 59.76% <ø> (+0.39%) ⬆️
docs-creds-needed 58.34% <ø> (+0.38%) ⬆️
docs-spark 57.81% <ø> (+0.38%) ⬆️

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.

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

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