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] Add Metric and Domain base classes #10920

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

NathanFarmer
Copy link
Contributor

@NathanFarmer NathanFarmer commented Feb 7, 2025

This PR adds new Metric and Domain base classes for defining and instantiating metrics.

Example metric definition:

class Between(Metric[ColumnMap]):
    min_value: Optional[Comparable] = None
    max_value: Optional[Comparable] = None
    strict_min: bool = False
    strict_max: bool = False

Example metric instantiation:

Between(
    ColumnMap(
        batch_id=...,
        table=...,
        column=...,
    ),
    min_value=...,
    max_value=...,
)

  • 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

@NathanFarmer NathanFarmer self-assigned this Feb 7, 2025
Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit daf7f0c
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/67a9095f3468a60008934a5f

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.80%. Comparing base (5c60408) to head (daf7f0c).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
great_expectations/metrics/metric.py 97.29% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10920      +/-   ##
===========================================
+ Coverage    80.77%   80.80%   +0.02%     
===========================================
  Files          465      469       +4     
  Lines        40620    40683      +63     
===========================================
+ Hits         32812    32874      +62     
- Misses        7808     7809       +1     
Flag Coverage Δ
3.10 70.13% <98.41%> (+0.04%) ⬆️
3.10 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.54% <71.42%> (?)
3.10 aws_deps 46.45% <71.42%> (?)
3.10 big 54.93% <71.42%> (?)
3.10 bigquery 48.70% <71.42%> (?)
3.10 clickhouse 43.34% <71.42%> (?)
3.10 databricks 50.47% <71.42%> (?)
3.10 filesystem 62.88% <71.42%> (?)
3.10 mssql 51.48% <71.42%> (?)
3.10 mysql 51.86% <71.42%> (?)
3.10 postgresql 54.49% <71.42%> (?)
3.10 snowflake 51.22% <71.42%> (?)
3.10 spark 57.82% <71.42%> (?)
3.10 spark_connect 46.78% <71.42%> (?)
3.10 trino 52.40% <71.42%> (?)
3.11 70.11% <98.41%> (+0.02%) ⬆️
3.11 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.54% <71.42%> (?)
3.11 aws_deps 46.45% <71.42%> (?)
3.11 big 54.93% <71.42%> (?)
3.11 bigquery 48.70% <71.42%> (?)
3.11 clickhouse 43.34% <71.42%> (?)
3.11 databricks 50.48% <71.42%> (?)
3.11 filesystem 62.88% <71.42%> (?)
3.11 mssql 51.48% <71.42%> (?)
3.11 mysql 51.86% <71.42%> (?)
3.11 postgresql 54.49% <71.42%> (?)
3.11 snowflake 51.22% <71.42%> (?)
3.11 spark 57.82% <71.42%> (?)
3.11 spark_connect 46.78% <71.42%> (?)
3.11 trino 52.40% <71.42%> (?)
3.12 70.11% <98.41%> (+0.02%) ⬆️
3.12 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.54% <71.42%> (+0.02%) ⬆️
3.12 aws_deps 46.45% <71.42%> (+0.03%) ⬆️
3.12 big 54.93% <71.42%> (+0.02%) ⬆️
3.12 bigquery 48.70% <71.42%> (+0.03%) ⬆️
3.12 databricks 50.48% <71.42%> (+0.03%) ⬆️
3.12 filesystem 62.88% <71.42%> (+0.01%) ⬆️
3.12 mssql 51.48% <71.42%> (+0.03%) ⬆️
3.12 mysql 51.86% <71.42%> (+0.03%) ⬆️
3.12 postgresql 54.50% <71.42%> (+0.02%) ⬆️
3.12 snowflake 51.22% <71.42%> (+0.03%) ⬆️
3.12 spark 57.83% <71.42%> (+0.02%) ⬆️
3.12 spark_connect 46.78% <71.42%> (+0.03%) ⬆️
3.12 trino 52.41% <71.42%> (+0.02%) ⬆️
3.9 70.14% <98.41%> (+0.02%) ⬆️
3.9 athena or openpyxl or pyarrow or project or sqlite or aws_creds 56.54% <71.42%> (+0.02%) ⬆️
3.9 aws_deps 46.47% <71.42%> (+0.03%) ⬆️
3.9 big 54.94% <71.42%> (+0.02%) ⬆️
3.9 bigquery 48.69% <71.42%> (+0.03%) ⬆️
3.9 clickhouse 43.36% <71.42%> (+0.04%) ⬆️
3.9 databricks 50.48% <71.42%> (+0.03%) ⬆️
3.9 filesystem 62.89% <71.42%> (+0.01%) ⬆️
3.9 mssql 51.46% <71.42%> (+0.03%) ⬆️
3.9 mysql 51.84% <71.42%> (+0.03%) ⬆️
3.9 postgresql 54.48% <71.42%> (+0.02%) ⬆️
3.9 snowflake 51.22% <71.42%> (+0.03%) ⬆️
3.9 spark 57.79% <71.42%> (+0.02%) ⬆️
3.9 spark_connect 46.79% <71.42%> (+0.03%) ⬆️
3.9 trino 52.39% <71.42%> (+0.02%) ⬆️
cloud 0.00% <0.00%> (ø)
docs-basic 53.91% <0.00%> (-0.09%) ⬇️
docs-creds-needed 52.79% <0.00%> (-0.09%) ⬇️
docs-spark 52.34% <0.00%> (-0.09%) ⬇️

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.

@NathanFarmer NathanFarmer changed the title [MAINTENANCE] Add Metric and MapMetric abstract classes [MAINTENANCE] Add Metric and Domain base classes Feb 9, 2025
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.

1 participant