-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]
ValidationConfigStore
(#9523)
Co-authored-by: Bill Dirks <bill@greatexpectations.io>
- Loading branch information
Showing
26 changed files
with
472 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
great_expectations/data_context/store/validation_config_store.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from __future__ import annotations | ||
|
||
from great_expectations.compatibility.typing_extensions import override | ||
from great_expectations.core.data_context_key import StringKey | ||
from great_expectations.core.validation_config import ValidationConfig | ||
from great_expectations.data_context.cloud_constants import GXCloudRESTResource | ||
from great_expectations.data_context.store.store import Store | ||
from great_expectations.data_context.types.resource_identifiers import ( | ||
GXCloudIdentifier, | ||
) | ||
|
||
|
||
class ValidationConfigStore(Store): | ||
_key_class = StringKey | ||
|
||
def get_key( | ||
self, name: str, id: str | None = None | ||
) -> GXCloudIdentifier | StringKey: | ||
"""Given a name and optional ID, build the correct key for use in the ValidationConfigStore.""" | ||
if self.cloud_mode: | ||
return GXCloudIdentifier( | ||
resource_type=GXCloudRESTResource.VALIDATION_CONFIG, | ||
id=id, | ||
resource_name=name, | ||
) | ||
return StringKey(key=name) | ||
|
||
@override | ||
def serialize(self, value): | ||
if self.cloud_mode: | ||
data = value.dict() | ||
data["suite"] = data["suite"].to_json_dict() | ||
return data | ||
|
||
return value.json() | ||
|
||
@override | ||
def deserialize(self, value): | ||
return ValidationConfig.parse_raw(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.