Skip to content
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

Merged
merged 6 commits into from
Mar 7, 2024
Merged

Conversation

cdkini
Copy link
Member

@cdkini cdkini commented Mar 6, 2024

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

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!

Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit a89e569
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/65e9f2f61d90d40008c48e01


@public_api
def save(self) -> None:
store = project_manager.get_validation_config_store()
Copy link
Contributor

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.

Copy link
Member Author

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)
Copy link
Contributor

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.

@cdkini cdkini added this pull request to the merge queue Mar 7, 2024
Merged via the queue into develop with commit c9cfa2d Mar 7, 2024
67 checks passed
@cdkini cdkini deleted the m/v1-223/validation_config_save branch March 7, 2024 17:51
deborahniesz pushed a commit that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants