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] Standardize result object from Checkpoint action runs #10647

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

Conversation

cdkini
Copy link
Member

@cdkini cdkini commented Nov 8, 2024

We should have a consistent API for ValidationAction.run - this new model is a lightweight wrapper around a status and the existing payload but should allow us to be better prepared for extensibility that users want.

  • 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, visit our community resources.

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 Nov 8, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit ab11718
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/672e9261bf71a500087ae11d

@cdkini cdkini changed the title [MAINTENANCE] Better error reporting around Checkpoint action failures [MAINTENANCE] Standardize reuslt object from Checkpoint action runs Nov 8, 2024
@cdkini cdkini changed the title [MAINTENANCE] Standardize reuslt object from Checkpoint action runs [MAINTENANCE] Standardize result object from Checkpoint action runs Nov 8, 2024
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.

Project coverage is 80.38%. Comparing base (d51f6c0) to head (ab11718).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
great_expectations/checkpoint/actions.py 87.17% 5 Missing ⚠️
great_expectations/checkpoint/util.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #10647   +/-   ##
========================================
  Coverage    80.37%   80.38%           
========================================
  Files          463      463           
  Lines        40113    40130   +17     
========================================
+ Hits         32241    32258   +17     
  Misses        7872     7872           
Flag Coverage Δ
3.10 68.10% <82.60%> (+0.01%) ⬆️
3.10 athena or openpyxl or pyarrow or project or sqlite or aws_creds ?
3.10 aws_deps ?
3.10 big ?
3.10 clickhouse ?
3.10 filesystem ?
3.10 mssql ?
3.10 mysql ?
3.10 postgresql ?
3.10 spark_connect ?
3.10 trino ?
3.11 68.10% <82.60%> (+0.01%) ⬆️
3.11 athena or openpyxl or pyarrow or project or sqlite or aws_creds ?
3.11 aws_deps ?
3.11 big ?
3.11 clickhouse ?
3.11 filesystem ?
3.11 mssql ?
3.11 mysql ?
3.11 postgresql ?
3.11 spark_connect ?
3.11 trino ?
3.12 68.10% <82.60%> (+0.01%) ⬆️
3.12 athena or openpyxl or pyarrow or project or sqlite or aws_creds 55.42% <41.30%> (+<0.01%) ⬆️
3.12 aws_deps 46.15% <30.43%> (+<0.01%) ⬆️
3.12 big 54.75% <30.43%> (-0.01%) ⬇️
3.12 databricks 47.89% <39.13%> (+<0.01%) ⬆️
3.12 filesystem 61.72% <56.52%> (+<0.01%) ⬆️
3.12 mssql 51.49% <30.43%> (-0.01%) ⬇️
3.12 mysql 51.56% <30.43%> (-0.01%) ⬇️
3.12 postgresql 54.64% <39.13%> (+<0.01%) ⬆️
3.12 snowflake 48.87% <39.13%> (+<0.01%) ⬆️
3.12 spark 58.07% <39.13%> (+<0.01%) ⬆️
3.12 spark_connect 46.44% <30.43%> (+<0.01%) ⬆️
3.12 trino 52.69% <39.13%> (+<0.01%) ⬆️
3.9 68.12% <82.60%> (+<0.01%) ⬆️
3.9 athena or openpyxl or pyarrow or project or sqlite or aws_creds 55.42% <41.30%> (+<0.01%) ⬆️
3.9 aws_deps 46.17% <30.43%> (+<0.01%) ⬆️
3.9 big 54.76% <30.43%> (-0.01%) ⬇️
3.9 clickhouse 43.04% <30.43%> (+<0.01%) ⬆️
3.9 databricks 47.91% <39.13%> (+<0.01%) ⬆️
3.9 filesystem 61.74% <56.52%> (+<0.01%) ⬆️
3.9 mssql 51.48% <30.43%> (-0.01%) ⬇️
3.9 mysql 51.54% <30.43%> (-0.01%) ⬇️
3.9 postgresql 54.62% <39.13%> (+<0.01%) ⬆️
3.9 snowflake 48.88% <39.13%> (+<0.01%) ⬆️
3.9 spark 58.03% <39.13%> (+<0.01%) ⬆️
3.9 spark_connect 46.46% <30.43%> (+<0.01%) ⬆️
3.9 trino 52.67% <39.13%> (+<0.01%) ⬆️
cloud ?
docs-basic 53.37% <45.65%> (+<0.01%) ⬆️
docs-creds-needed 52.94% <45.65%> (+<0.01%) ⬆️
docs-spark 52.42% <45.65%> (+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.

@cdkini cdkini marked this pull request as ready for review November 8, 2024 18:14
Copy link
Contributor

@billdirks billdirks left a comment

Choose a reason for hiding this comment

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

Thanks for standardizing this more. I left a few comments inline.

run_info: A dictionary containing information about the run.
"""

status: ValidationActionRunStatus
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include the action name (eg the class name) in this result object or will it be obvious since this is embedded inside something? Eg if I see not_run will I know that is associated with a pager duty action?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the run_info dict has a key which is a string like <action_type>_result. If we put the action type in it's own field, it would make that info easier to parse out.

Copy link
Member Author

Choose a reason for hiding this comment

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

It'll be obvious since this is only ever used in Checkpoint.run - my thinking is we can take the aggregated results (of these actions) and either log or append to the checkpoint result object.

Don't want to make too many changes here until we can plan better.

"""

status: ValidationActionRunStatus
run_info: dict
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the run_info vary from action to action or can we be more concrete about this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah I don't love our current dicts but I'm trying to minimize changes. They're all pretty much {"action_type_in_snake_case": "success_or_failure"} so they could be simplified with a simple bool but I think I want to keep it this way for a few reasons:

  1. Minimize changes (for now)
  2. Allow for more complex run_info (UpdateDataDocs leverages this and future custom actions might want to include more details?)

return {"pagerduty_alert_result": "none sent"}
return ValidationActionResult(
status=ValidationActionRunStatus.NOT_RUN,
run_info={"pagerduty_alert_result": "none sent"},
Copy link
Contributor

Choose a reason for hiding this comment

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

For ms teams, the equivalent value is None instead of "none sent". Can these be the same thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same note as above - don't love these dicts but doing what I can to minimize changes. If we can determine a consistent standard, I'd be happy to make changes across the board.

@@ -427,6 +432,9 @@ def test_run_integration_success(
self,
checkpoint_result: CheckpointResult,
):
if not os.environ.get("GX_MS_TEAMS_WEBHOOK"):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like programmatically skipping tests. What has happened in the past is someone makes a change and we start skipping this in CI without realizing it. I'd rather just fail and require this env variable or have this moved to a different marker where we require this.

Comment on lines +301 to +304

action_results = self._run_actions(checkpoint_result=checkpoint_result)
# TODO(cdkini): Figure out how to handle action results
print(action_results) # We could add these to our checkpoint result or logger.warning?
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 where I'm unsure but the goal with this whole effort is to make action results more transparent - we currently silently fail or skip

Copy link
Member Author

Choose a reason for hiding this comment

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

If we log, there's still a chance can lose track of it.
I'd lean towards updating the checkpoint result but we need to be careful about what we add there - don't want it becoming as cumbersome as its V0 counterpart.

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