Support of special attribute updates in add_property
All threads resolved!
Summary
The Entity.add_property method now checks whether the name of an added property matches a special attribute and, if so, updates the attribute instead.
Addresses #217
Focus
- Should similar behaviour be supported for updates using only id? If so, how would I go about finding out which id the name attribute/property has server-side?
- As the method is called add_property and special attributes do not support multi-properties (as far as I know?), should we guard against an overwrite by only setting the attribute if it is currently None?
Test Environment
A unit test is included, is it sufficient?
Check List for the Author
-
All automated tests pass -
Reference related issues -
Up-to-date CHANGELOG.md (or not necessary) -
Up-to-date JSON schema (or not necessary) -
Appropriate user and developer documentation (or not necessary) -
Annotations in code (Gitlab comments) - Intent of new code
- Problems with old code
- Why this implementation?
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md (or not necessary) -
Appropriate user and developer documentation (or not necessary) -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there specifications? Are they satisfied?
Edited by I. Nüske
Merge request reports
Activity
assigned to @i.nueske
mentioned in issue #217
- Resolved by Florian Spreckelsen
- Resolved by Florian Spreckelsen
requested review from @florian
added 9 commits
-
c52be307...c9d6b270 - 7 commits from branch
dev
- 9fb853a5 - Merge branch 'dev' into f-217-set-special-property
- bbbc0f3e - DOC: Update changelog
-
c52be307...c9d6b270 - 7 commits from branch
Regarding your two questions, as a result of our discussion:
- add a TODO for special attributes given by id (both in code and a new issue), but leave it for now
- Raise an error if add_property would overwrite an attribute which is not None. Also add a test for this to the new unit test.
Also, you should update the docstring and possibly, the documentation with the new behavior.
added 1 commit
- 092b1863 - ENH: Update add_property to prevent overwriting special attributes
added 1 commit
- 2e69dca0 - ENH: Update add_property docstring, make special attribute case-insensitive
added 4 commits
-
2e69dca0...0dbb1a19 - 3 commits from branch
dev
- cf6035a1 - Merge branch 'dev' into f-217-set-special-property
-
2e69dca0...0dbb1a19 - 3 commits from branch
Please register or sign in to reply