Skip to content
Snippets Groups Projects

Support of special attribute updates in add_property

Open I. Nüske requested to merge f-217-set-special-property into dev
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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I. Nüske
  • I. Nüske marked the checklist item Annotations in code (Gitlab comments) as completed

    marked the checklist item Annotations in code (Gitlab comments) as completed

  • I. Nüske requested review from @florian

    requested review from @florian

  • added 9 commits

    Compare with previous version

  • Florian Spreckelsen resolved all threads

    resolved all threads

  • 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.

  • I. Nüske added 1 commit

    added 1 commit

    • 092b1863 - ENH: Update add_property to prevent overwriting special attributes

    Compare with previous version

  • I. Nüske added 1 commit

    added 1 commit

    • 2e69dca0 - ENH: Update add_property docstring, make special attribute case-insensitive

    Compare with previous version

  • added 4 commits

    Compare with previous version

  • Florian Spreckelsen approved this merge request

    approved this merge request

  • Approved, but needs to wait until the crawler code has been adapted.

  • Please register or sign in to reply
    Loading