Take into account entity role for retrieval / use get_entity_by_name
Summary
Addresses https://gitlab.com/linkahead/linkahead-pylib/-/issues/123 and #198
Container.retrieve now uses get_entity_by_name for retrieval of entities without id and matches the role if given.
Test-MR: caosdb-pyinttest!87
Focus
- This is likely significantly slower than before, and makes a lot more requests for large Containers with entities without ids. Is this acceptable? If not, would an additional parameter to specify which behaviour is wanted be a usable compromise?
- To offset the performance hit, get_entity_by_id is not used. Is this ok?
- The manual query for file retrieval with a path was replaced by get_entity_by_path, is this likely to break anything?
Test Environment
Manual Tests
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)
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 Alexander Schlemmer