-
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] DataContextVariableKey
for use in Stores
#5255
[MAINTENANCE] DataContextVariableKey
for use in Stores
#5255
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 |
class DataContextVariableKey(DataContextKey): | ||
def __init__( | ||
self, | ||
resource_type: DataContextVariableSchema, | ||
resource_name: Optional[str] = None, | ||
) -> None: | ||
self._resource_type = resource_type | ||
self._resource_name = resource_name |
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.
Some DataContextVariables
are strings or other single values while other ones are dictionaries.
If I want to use my InlineStoreBackend
to add a new datasource or store, I want the ability to specify my type (i.e. datasource or store) as well as the name associated with the new object (i.e. my_new_datasource or my_new_store).
The old StringKey
did not allow for this flexibility.
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.
Thank you for this PR 😄 Just a few small items to address.
great_expectations/data_context/types/data_context_variables.py
Outdated
Show resolved
Hide resolved
great_expectations/data_context/types/data_context_variables.py
Outdated
Show resolved
Hide resolved
from great_expectations.data_context.types.base import DataContextConfig | ||
from great_expectations.data_context.types.data_context_variables import ( | ||
DataContextVariableSchema, | ||
) | ||
from great_expectations.exceptions.exceptions import StoreBackendError | ||
from great_expectations.util import filter_properties_dict | ||
|
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.
I know this code wasn't modified in this PR, and can be done in a different PR but we should have a docstring for the class that describes what an InlineStoreBackend is. Including mentioning that it is only for use with file-backed data contexts (DataContext
and FileDataContext
).
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.
I definitely agree - should have added this during my initial implementation!
Updated but please let me know if you think anything else should be added.
…_expectations into feature/great-889/great-937/data-context-variable-key
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.
LGTM!
…tations#5255) * feat: initial commit * fix: fix retrieval bug due to substitution * feat: use enum instead of strings * chore: update linter thresholds * chore: respond to initial round of comments * test: write integration test
Changes proposed in this pull request:
DatasourceStore
to utilize a new key calledDataContextVariableKey
StringKey
that was previously used.Definition of Done
Please delete options that are not relevant.
Thank you for submitting!