-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[FEATURE] V1 Validation scaffolding #9508
Changes from 1 commit
b718df3
3660097
86a8e46
be2240e
f088aa7
32862f6
ccfc32e
bd6144f
c79d06d
8ceb81b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .checkpoint_factory import CheckpointFactory | ||
from .suite_factory import SuiteFactory | ||
from .validation_factory import ValidationFactory |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from great_expectations._docs_decorators import public_api | ||
from great_expectations.compatibility.typing_extensions import override | ||
from great_expectations.core.factory.factory import Factory | ||
|
||
if TYPE_CHECKING: | ||
from great_expectations.core.validation import Validation | ||
from great_expectations.data_context.store.validations_store import ValidationsStore | ||
|
||
|
||
# TODO: Add analytics as needed | ||
class ValidationFactory(Factory[Validation]): | ||
def __init__(self, store: ValidationsStore) -> None: | ||
self._store = store | ||
|
||
@public_api | ||
@override | ||
def add(self, validation: Validation) -> Validation: | ||
"""Add a Validation to the collection. | ||
|
||
Parameters: | ||
validation: Validation to add | ||
|
||
Raises: | ||
DataContextError if Validation already exists | ||
""" | ||
raise NotImplementedError | ||
|
||
@public_api | ||
@override | ||
def delete(self, validation: Validation) -> Validation: | ||
"""Delete a Validation from the collection. | ||
|
||
Parameters: | ||
validation: Validation to delete | ||
|
||
Raises: | ||
DataContextError if Validation doesn't exist | ||
""" | ||
raise NotImplementedError | ||
|
||
@public_api | ||
@override | ||
def get(self, name: str) -> Validation: | ||
"""Get a Validation from the collection by name. | ||
|
||
Parameters: | ||
name: Name of Validation to get | ||
|
||
Raises: | ||
DataContextError when Validation is not found. | ||
""" | ||
raise NotImplementedError |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from great_expectations.core.batch_config import BatchConfig | ||
from great_expectations.core.expectation_suite import ExpectationSuite | ||
from great_expectations.datasource.fluent.interfaces import DataAsset | ||
|
||
|
||
class Validation: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want this to be a Pydantic model? Went back and forth on it but figured its a pretty lightweight object so we can just add it if we need (probably when persistence comes into question?) |
||
""" | ||
TBD | ||
""" | ||
|
||
def __init__( | ||
self, | ||
name: str, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not part of the spec but we need an identifier if we want persistence |
||
data: DataAsset | BatchConfig, | ||
expectation_suite: ExpectationSuite, | ||
) -> None: | ||
self._name = name | ||
self._data = data | ||
self._suite = expectation_suite | ||
|
||
@property | ||
def name(self) -> str: | ||
return self._name | ||
|
||
@property | ||
def data(self) -> BatchConfig: | ||
return self._data | ||
|
||
@property | ||
def suite(self) -> ExpectationSuite: | ||
return self._suite | ||
|
||
def run(self): | ||
raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current store won't work so we'll need to update accordingly