-
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
[FEATURE] ValidationConfig.save()
#9579
Conversation
✅ Deploy Preview for niobium-lead-7998 canceled.
|
|
||
@public_api | ||
def save(self) -> None: | ||
store = project_manager.get_validation_config_store() |
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.
Didn't we say we want the pattern here to be that we get the store upon initialization? (e.g. that's what we do for expectation suites). Both for raising earlier, and for predictability in case someone switches contexts. I think we could hijack a root_validator for this, even though I don't love it.
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.
Ah okay yeah wasn’t sure the pattern to follow when using Pydantic but you’re right
context = ephemeral_context | ||
vc = validation_config | ||
|
||
vc = context.validations.add(vc) |
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.
nit: to make the intention of the test here more clear, having the initial context.validations.add(vc)
being done in a fixture might make sense, e.g. like a saved_validation_config
fixture.
invoke lint
(usesruff format
+ruff check
)For more information about contributing, see Contribute.
After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!