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

DM-18900: Raise RuntimeError if replacing specs/partials #41

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonathansick
Copy link
Member

It seems that silently overwriting specifications or partials is leading to hard-to-debug issues. This makes SpecificationSet raise a RuntimeError exception if specifications or partials are being ingested
that replace previously-ingested specifications or partials of the same name.

This also consolidates the act few setting the internals _specs and _partials dicts to the getitem method. Regular code shouldn't be touching _specs or _partials.

Adjust tests to deal with new behavior

I'm not sure this should be merged yet because there may be cases where replacement is useful (such as in an update method). Let's figure out how to make replacement possible when useful, but not when a YAML package is being ingested.

It seems that silently overwriting specifications or partials is leading
to hard-to-debug issues. This makes SpecificationSet raise a
RuntimeError exception if specifications or partials are being ingested
that replace previously-ingested specifications or partials of the same
name.

This also consolidates the act few setting the internals _specs and
_partials dicts to the __getitem__ method. Regular code shouldn't be
touching _specs or _partials.

Adjust tests to deal with new behavior
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.

1 participant