Skip to content
Snippets Groups Projects

F entity role

Merged Timm Fitschen requested to merge f-entity-role into dev

Summary

Fixes unintuitive behavior of "Entity.role" after a retrieval.

(As per the bug report in the CaosDB matrix chat)

  1. When an entity is retrieved with a class (i.e. a subtype of Entity) which does not match the entity role, an exception is being raised.
  2. When an entity is retrieved using the Entity class, the correct role is set and available via Entity.role

Focus

The only real changes are in models.py. See the annotations for more info.

Everything else is just new tests covering the changes.

Test Environment

Check List for the Author

  • All automated tests pass
  • Reference related Issues
  • Up-to-date CHANGELOG.md
  • 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
  • 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 spezifications? Are they satisfied?
  • remove xfail from pyint test (line 587; test_misc.py): @mark.xfail(reason="Waits for MR https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/merge_requests/15")

For further good practices have a look at our review guidelines.

Edited by Alexander Kreft

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
  • Timm Fitschen
  • Timm Fitschen
  • Timm Fitschen added 1 commit

    added 1 commit

    Compare with previous version

  • Timm Fitschen changed the description

    changed the description

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

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

  • Timm Fitschen marked the checklist item Up-to-date CHANGELOG.md as completed

    marked the checklist item Up-to-date CHANGELOG.md as completed

  • Timm Fitschen marked the checklist item Reference related Issues as completed

    marked the checklist item Reference related Issues as completed

  • Timm Fitschen requested review from @salexan

    requested review from @salexan

  • Alexander Schlemmer
  • Alexander Schlemmer
  • Alexander Schlemmer
  • Alexander Schlemmer marked the checklist item I understand the intent of this MR as completed

    marked the checklist item I understand the intent of this MR as completed

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading