-
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
[MAINTENANCE] Add suite_name
to ExpectationSuiteValidationResult
#9677
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -503,13 +503,15 @@ class ExpectationSuiteValidationResult(SerializableDictDot): | |
evaluation_parameters: Dict of Evaluation Parameters used to produce these results, or None. | ||
statistics: Dict of values describing the results. | ||
meta: Instance of ExpectationSuiteValidationResult, a Dict of meta values, or None. | ||
|
||
batch_id: A unique identifier for the batch of data that was validated. | ||
result_url: A URL where the results are stored. | ||
""" # noqa: E501 | ||
|
||
def __init__( # noqa: PLR0913 | ||
self, | ||
success: Optional[bool] = None, | ||
results: Optional[list] = None, | ||
success: bool, | ||
results: list[ExpectationValidationResult], | ||
suite_name: str, | ||
evaluation_parameters: Optional[dict] = None, | ||
statistics: Optional[dict] = None, | ||
meta: Optional[ExpectationSuiteValidationResult | dict] = None, | ||
|
@@ -518,21 +520,16 @@ def __init__( # noqa: PLR0913 | |
id: Optional[str] = None, | ||
) -> None: | ||
self.success = success | ||
if results is None: | ||
results = [] | ||
self.results = results | ||
if evaluation_parameters is None: | ||
evaluation_parameters = {} | ||
self.evaluation_parameters = evaluation_parameters | ||
if statistics is None: | ||
statistics = {} | ||
self.statistics = statistics | ||
if meta is None: | ||
meta = {} | ||
self.suite_name = suite_name | ||
self.evaluation_parameters = evaluation_parameters or {} | ||
self.statistics = statistics or {} | ||
meta = meta or {} | ||
ensure_json_serializable(meta) # We require meta information to be serializable. | ||
self.meta = meta | ||
self.batch_id = batch_id | ||
self.result_url = result_url | ||
self.id = id | ||
self._metrics: dict = {} | ||
|
||
def __eq__(self, other): | ||
|
@@ -632,6 +629,7 @@ def get_failed_validation_results( | |
return ExpectationSuiteValidationResult( | ||
success=success, | ||
results=validation_results, | ||
suite_name=self.suite_name, | ||
evaluation_parameters=self.evaluation_parameters, | ||
statistics=statistics, | ||
meta=self.meta, | ||
|
@@ -654,11 +652,11 @@ def describe(self) -> str: | |
class ExpectationSuiteValidationResultSchema(Schema): | ||
success = fields.Bool() | ||
results = fields.List(fields.Nested(ExpectationValidationResultSchema)) | ||
suite_name = fields.String(required=True, allow_none=False) | ||
evaluation_parameters = fields.Dict() | ||
statistics = fields.Dict() | ||
meta = fields.Dict(allow_none=True) | ||
id = fields.UUID(required=False, allow_none=True) | ||
checkpoint_name = fields.String(required=False, allow_none=True) | ||
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. This was wrong - it might be in meta but shouldn't be at the top level |
||
|
||
# noinspection PyUnusedLocal | ||
@pre_dump | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These should be guaranteed fields - what is a result if we don't have results, an origin suite, and a success metric?