-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(bc): only remove terms when asked #2060
Conversation
6f06908
to
07985c3
Compare
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.
Good job! Some little improvements could be done.
terms_to_remove = {key for key in updated_cfg if ("%" in key or "." in key) and key not in updated_terms} | ||
for term_id in terms_to_remove: | ||
updated_cfg.pop(term_id, None) | ||
updated_properties = self.dict(exclude={"command_context", "command_name", "version", "id"}, exclude_none=True) |
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.
You should use:
excluded_fields = frozenset(ICommand.__fields__)
updated_properties = self.dict(exclude=excluded_fields, exclude_none=True)
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 needed to add the id
which is not in the ICommand
fields so the code goes like this :
excluded_fields = set(ICommand.__fields__) | {"id"}
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
5aab71c
to
c9d5409
Compare
Rollback to old behavior (prior to #2052) + handle last term deletion