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

[DOCS] Update public_api to include ValidationAction components #10752

Merged
merged 9 commits into from
Dec 19, 2024
5 changes: 0 additions & 5 deletions docs/sphinx_api_docs_source/public_api_excludes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
reason="Exclude code from __init__.py",
filepath=pathlib.Path("great_expectations/types/__init__.py"),
),
IncludeExcludeDefinition(
reason="ValidationActions are now run from Checkpoints: https://docs.greatexpectations.io/docs/guides/miscellaneous/migration_guide#manually-migrate-v2-checkpoints-to-v3-checkpoints",
name="run",
filepath=pathlib.Path("great_expectations/checkpoint/actions.py"),
),
IncludeExcludeDefinition(
reason="False match for from datasource_configuration_test_utilities import is_subset",
name="is_subset",
Expand Down
21 changes: 21 additions & 0 deletions great_expectations/checkpoint/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ def data(self) -> list[tuple[ValidationAction, dict]]:
def update(self, action: ValidationAction, action_result: dict) -> None:
self._data.append((action, action_result))

@public_api
def filter_results(self, class_: Type[ValidationAction]) -> list[dict]:
"""
Filter the results of the actions in the context by class.

Args:
class_: The class to filter by.

Returns:
A list of action results.
"""
return [action_result for action, action_result in self._data if isinstance(action, class_)]


Expand Down Expand Up @@ -202,9 +212,20 @@ class Config:
def _using_cloud_context(self) -> bool:
return project_manager.is_using_cloud()

@public_api
def run(
self, checkpoint_result: CheckpointResult, action_context: ActionContext | None = None
) -> dict:
"""
Run the action.

Args:
checkpoint_result: The result of the checkpoint run.
action_context: The context in which the action is run.

Returns:
A dictionary containing the result of the action.
"""
raise NotImplementedError

def _get_data_docs_pages_from_prior_action(
Expand Down
Loading