-
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] Migrate remaining methods from BaseDataContext
#6403
[MAINTENANCE] Migrate remaining methods from BaseDataContext
#6403
Conversation
✅ Deploy Preview for niobium-lead-7998 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
👇 Click on the image for a new way to code review
Legend |
@abstractmethod | ||
@usage_statistics_enabled_method( | ||
event_name=UsageStatsEvents.DATA_CONTEXT_SAVE_EXPECTATION_SUITE, | ||
args_payload_fn=save_expectation_suite_usage_statistics, | ||
) |
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.
The implementation is pretty much the same across the hierarchy so let's remove some impls and the @abstracmethod
decorator and put the default impl here. Note we're still overriding in CloudDataContext
due to the GXCloudIdentifier
creation logic.
Further work can be done here but for now, I think this feels pretty good.
@@ -3724,3 +3756,52 @@ def escape_all_config_variables( | |||
return value.replace("$", dollar_sign_escape_string) | |||
return value | |||
return value.replace("$", dollar_sign_escape_string) | |||
|
|||
def save_config_variable( |
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 method has some pretty filesystem specific logic but a larger overhaul to file-based logic will occur shortly.
In short, both FileDataContext
and CloudDataContext
have "fileystem-enabled" capabilities - these two classes should inherit from a separate _FilesystemEnabledDataContext
or something to that effect.
For now, I think it's okay to put in AbstractDataContext
.
0d69f1d
to
bdfa181
Compare
…_expectations into m/great-1389/migrate_final_base_context_methods
def save_expectation_suite( | ||
self, | ||
expectation_suite: ExpectationSuite, | ||
expectation_suite_name: Optional[str] = None, | ||
overwrite_existing: bool = True, | ||
include_rendered_content: Optional[bool] = None, | ||
**kwargs: Optional[dict], | ||
) -> None: | ||
self._data_context.save_expectation_suite( | ||
expectation_suite, | ||
expectation_suite_name=expectation_suite_name, | ||
overwrite_existing=overwrite_existing, | ||
include_rendered_content=include_rendered_content, | ||
**kwargs, | ||
) |
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.
An unfortunate necessity to get things working - this will be removed in GREAT-1379 (converting the BaseDataContext
into a facade 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.
Sounds good :) thanks for the note
@@ -508,6 +513,10 @@ def get_expectation_suite( | |||
expectation_suite.render() | |||
return expectation_suite | |||
|
|||
@usage_statistics_enabled_method( |
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.
🙇
@@ -264,6 +264,22 @@ def __init__( | |||
if self._check_for_usage_stats_sync(project_config): | |||
self._save_project_config() | |||
|
|||
def _save_project_config(self) -> None: |
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.
❤️
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.
Looks great :) Thank you @cdkini
* develop: (22 commits) [BUGFIX] issue-4295-fix-issue (#6164) [DOCS] add boto3 explanations on document (#6407) [FEATURE] add multiple column metric (#6372) [MAINTENANCE] Small refactor (#6422) [MAINTENANCE] Sorting batch IDs and typehints clean up (#6421) [MAINTENANCE] Clean Up Type Hints and Minor Refactoring For Better Code Elegance/Readability (#6418) [MAINTENANCE] Implement `RendererConfiguration` (#6412) [BUGFIX] updated capitalone setup.py file (#6410) [FEATURE]: DataProfilerUnstructuredDataAssistant Integration (#6400) [FEATURE] add new metric - query template values (#5994) [MAINTENANCE] Cleanup For Better Code Elegance/Readability (#6406) [MAINTENANCE] ZEP - `GxConfig` cleanup (#6404) [MAINTENANCE] Migrate remaining methods from `BaseDataContext` (#6403) [BUGFIX] Patch key-generation issue with `DataContext.save_profiler()` (#6405) [MAINTENANCE] Migrate additional CRUD methods from `BaseDataContext` to `AbstractDataContext` (#6395) [MAINTENANCE] ZEP add yaml methods to all experimental models (#6401) [FEATURE] ZEP Config serialize as YAML (#6398) [MAINTENANCE] Remove call to verify_library_dependent_modules for pybigquery (#6394) [MAINTENANCE] Make "IDDict.to_id()" serialization more efficient. (#6389) [RELEASE] 0.15.34 (#6397) ...
Changes proposed in this pull request:
BaseDataContext
such that only the following remain:self._data_context
self._data_context
BaseDataContext
will become a true facade with a subsequent ticket - we'll pass any attr calls to the underlyingself._data_context
instance utilizing some Python magic (__getattr__
override)Definition of Done