-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Instrument test_yaml_config() #2981
[MAINTENANCE] Instrument test_yaml_config() #2981
Conversation
✔️ Deploy Preview for knoxpod ready! 🔨 Explore the source changes: b2adada 🔍 Inspect the deploy log: https://app.netlify.com/sites/knoxpod/deploys/60e47b793483a50007bbb470 😎 Browse the preview: https://deploy-preview-2981--knoxpod.netlify.app |
HOWDY! This is your friendly 🤖 CHANGELOG bot 🤖Please don't forget to add a clear and succinct description of your change under the Develop header in ✨ Thank you! ✨ |
"additionalProperties": True, | ||
# we don't want this to be true, but this is required to allow show_cta_footer | ||
# Note AJB-20201218 show_cta_footer was removed in v 0.9.9 via PR #1249 | ||
"required": ["parent_class"], |
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.
Note : these lines were moved here from another section. Don't worry about this :)
"anonymized_execution_engine": { | ||
"$ref": "#/definitions/anonymized_class_info" | ||
}, | ||
"anonymized_data_connectors": { | ||
"type": "array", | ||
"maxItems": 1000, | ||
"items": {"$ref": "#/definitions/anonymized_class_info"}, | ||
}, |
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.
Note : this was added by this PR (excuse the strange diff)
"__substitution_error__", | ||
"__yaml_parse_error__", | ||
"__custom_subclass_not_core_ge__", | ||
"__class_name_not_provided__", |
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.
more descriptive errors:
- substitution : variable substitution error (I dont exist)
- yaml parse : tabs are off in yaml
- not core GE : the class is not in the list in anonymizer or datacontext
- class_name not provided : we didn't have a class name for you
except Exception as e: | ||
usage_stats_event_payload: dict = { | ||
"diagnostic_info": ["__substitution_error__"], | ||
} | ||
send_usage_message( | ||
data_context=self, | ||
event=usage_stats_event_name, | ||
event_payload=usage_stats_event_payload, | ||
success=False, | ||
) | ||
raise e |
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.
this is how we generate a substitution_error
except Exception as e: | ||
usage_stats_event_payload: dict = { | ||
"diagnostic_info": ["__yaml_parse_error__"], | ||
} | ||
send_usage_message( | ||
data_context=self, | ||
event=usage_stats_event_name, | ||
event_payload=usage_stats_event_payload, | ||
success=False, | ||
) |
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.
yaml_parrse_error
generated here
if class_name == "SimpleSqlalchemyDatasource": | ||
# Use the raw config here, defaults will be added in the anonymizer | ||
usage_stats_event_payload = ( | ||
datasource_anonymizer.anonymize_simple_sqlalchemy_datasource( | ||
name=datasource_name, config=config | ||
) | ||
) |
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.
SimpleSqlalchemyDatasource
has a different class inheritance so handled separately
else: | ||
# If class_name is not a supported type or subclass of a supported type, | ||
# mark it as custom with no additional information since we can't anonymize | ||
usage_stats_event_payload[ | ||
"diagnostic_info" | ||
] = usage_stats_event_payload.get("diagnostic_info", []) + [ | ||
"__custom_subclass_not_core_ge__" | ||
] |
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.
not a core ge class and not a subclass .. then we dont know what it is. error.
# Test usage stats for test_yaml_config | ||
# - [x] test_test_yaml_config_usage_stats_substitution_error | ||
# - [x] test_test_yaml_config_usage_stats_yaml_parse_error | ||
# See test_data_context_test_yaml_config.test_config_with_yaml_error() | ||
# - [x] test_test_yaml_config_usage_stats_store_type | ||
# See test_data_context_test_yaml_config.test_expectations_store_with_filesystem_store_backend() | ||
# - [NA] test_test_yaml_config_usage_stats_datasource_type_v2 | ||
# - [x] test_test_yaml_config_usage_stats_datasource_type_v3 |
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.
this is ~ sniff ~ beautiful :)
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.
A true tour de force :) thank you for the well-thought-out design, implementation and testing. Leaving a few non-blocking requests for comments, first in the DataConnectorAnonymizer
and also in the classes that are used for testing (which we talked about last week). Otherwise LGTM! :)
great_expectations/core/usage_statistics/anonymizers/data_connector_anonymizer.py
Show resolved
Hide resolved
tests/data_context/fixtures/plugins/my_custom_expectations_store.py
Outdated
Show resolved
Hide resolved
tests/data_context/fixtures/plugins/my_custom_simple_sqlalchemy_datasource_class.py
Outdated
Show resolved
Hide resolved
tests/data_context/fixtures/plugins/my_custom_v2_api_datasource.py
Outdated
Show resolved
Hide resolved
tests/data_context/fixtures/plugins/my_custom_v3_api_datasource.py
Outdated
Show resolved
Hide resolved
…s_messages # Conflicts: # docs_rtd/changelog.rst
Instrument test_yaml_config() and update Anonymizers
Changes proposed in this pull request:
diagnostic_info
for errors)Definition of Done
Please delete options that are not relevant.