Skip to content

Commit

Permalink
[DOCS] Update public_api to include ValidationAction components (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
cdkini authored Dec 19, 2024
1 parent 5e11e7c commit 17c2383
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
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

0 comments on commit 17c2383

Please sign in to comment.