I am trying to pass a custom action to Great Expectations, i.e. a class implementing the ValidationAction interface:
from great_expectations.checkpoint.actions import ValidationAction
class StoreValidationResultsToDeltaAction(ValidationAction):
def __init__(self, att):
self.att = att
def _run(self, validation_result_suite, *args, **kwargs):
... # implementation
Normally if I use a FileDataContext I would just place this in a .py file under gx/plugins/<folder> and then when running the validation the action is loaded at runtime and executed.
I was hoping to do the same using an EphemeralDataContext:
data_context_config = DataContextConfig(
store_backend_defaults=InMemoryStoreBackendDefaults(),
plugins_directory="<path_to_plugins_folder_containing_action_class>"
)
gx_context = gx.get_context(project_config=data_context_config)
However it does not seem to work. Any idea how to achieve this?
I had the same issue, solved by simply pointing at the package where the custom action was implemented:
For me, the
pluginspackage is a subpackage of the one containing the code mentioned above, you'll probably have to change it to something else. As regards the custom action, that's a sample of how I specified it in checkpoint:Again, you'll have to change
class_nameandmodule_namevalues, then it should be good to go!