forked from great-expectations/great_expectations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MAINTENANCE] Instrument test_yaml_config() (great-expectations#2981)
Instrument test_yaml_config() and update Anonymizers
- Loading branch information
1 parent
e86e0e1
commit e274f29
Showing
26 changed files
with
2,753 additions
and
172 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
28 changes: 28 additions & 0 deletions
28
great_expectations/core/usage_statistics/anonymizers/checkpoint_anonymizer.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,28 @@ | ||
from great_expectations.checkpoint import Checkpoint, SimpleCheckpoint | ||
from great_expectations.core.usage_statistics.anonymizers.anonymizer import Anonymizer | ||
|
||
|
||
class CheckpointAnonymizer(Anonymizer): | ||
def __init__(self, salt=None): | ||
super().__init__(salt=salt) | ||
|
||
# ordered bottom up in terms of inheritance order | ||
self._ge_classes = [SimpleCheckpoint, Checkpoint] | ||
|
||
def anonymize_checkpoint_info(self, name, config): | ||
anonymized_info_dict = dict() | ||
anonymized_info_dict["anonymized_name"] = self.anonymize(name) | ||
|
||
self.anonymize_object_info( | ||
anonymized_info_dict=anonymized_info_dict, | ||
ge_classes=self._ge_classes, | ||
object_config=config, | ||
) | ||
|
||
return anonymized_info_dict | ||
|
||
def is_parent_class_recognized(self, config): | ||
return self._is_parent_class_recognized( | ||
classes_to_check=self._ge_classes, | ||
object_config=config, | ||
) |
53 changes: 53 additions & 0 deletions
53
great_expectations/core/usage_statistics/anonymizers/data_connector_anonymizer.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,53 @@ | ||
from great_expectations.core.usage_statistics.anonymizers.anonymizer import Anonymizer | ||
from great_expectations.datasource.data_connector import ( | ||
ConfiguredAssetFilePathDataConnector, | ||
ConfiguredAssetFilesystemDataConnector, | ||
ConfiguredAssetS3DataConnector, | ||
ConfiguredAssetSqlDataConnector, | ||
DataConnector, | ||
FilePathDataConnector, | ||
InferredAssetFilePathDataConnector, | ||
InferredAssetFilesystemDataConnector, | ||
InferredAssetS3DataConnector, | ||
InferredAssetSqlDataConnector, | ||
RuntimeDataConnector, | ||
) | ||
|
||
|
||
class DataConnectorAnonymizer(Anonymizer): | ||
def __init__(self, salt=None): | ||
super().__init__(salt=salt) | ||
|
||
# This list should contain all DataConnector types. When new DataConnector types | ||
# are created, please make sure to add ordered bottom up in terms of inheritance order | ||
self._ge_classes = [ | ||
InferredAssetS3DataConnector, | ||
InferredAssetFilesystemDataConnector, | ||
InferredAssetFilePathDataConnector, | ||
InferredAssetSqlDataConnector, | ||
ConfiguredAssetS3DataConnector, | ||
ConfiguredAssetFilesystemDataConnector, | ||
ConfiguredAssetFilePathDataConnector, | ||
ConfiguredAssetSqlDataConnector, | ||
RuntimeDataConnector, | ||
FilePathDataConnector, | ||
DataConnector, | ||
] | ||
|
||
def anonymize_data_connector_info(self, name, config): | ||
anonymized_info_dict = dict() | ||
anonymized_info_dict["anonymized_name"] = self.anonymize(name) | ||
|
||
self.anonymize_object_info( | ||
anonymized_info_dict=anonymized_info_dict, | ||
ge_classes=self._ge_classes, | ||
object_config=config, | ||
) | ||
|
||
return anonymized_info_dict | ||
|
||
def is_parent_class_recognized(self, config): | ||
return self._is_parent_class_recognized( | ||
classes_to_check=self._ge_classes, | ||
object_config=config, | ||
) |
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.