Conversation
|
Mostly an informational comment here since I missed the original discussion: with Ice, there's no difference between I don't know if it's possible, but if there's a way to represent the difference between "empty set" and "missing set" then it would be possible to track the callers' intent. |
002d80a to
47ca063
Compare
|
It may be that we decide that the web api never breaks links between objects when simply updating those objects. In webclient currently we use |
|
Adding an equivalent test for Project Annotation links (instead of Project-Dataset links). This seems to pass without needing to |
|
@chris-allan Thoughts on this PR and how to address this issue for web api? |
|
I haven't really had time to devote to a holistic approach to dealing with unloaded OMERO model objects and am unlikely to for at least another week to ten days. Certainly unloading a collection is a solution to this particular problem, is safe and avoids breaking links. However, unloaded objects are also a problem with "member" objects such as enumerations. The Image-Pixels-Channel hierarchy is littered with examples of this. So, we're going to have to come up with an implementation wide solution to the round-trip problem. |
|
It looks like we're not going to be able to support round-tripping for all the objects that we can read, at least for 5.3.0. I think this is OK as the majority of use-cases initially will be read-only. |
|
As discussed in meeting http://will-moore.github.io/presentations/2017/Web-Api-Update-Jan-2017/, omero-marshal will need to be smarter to handle decoding of unloaded data so that info is not lost on save. |
| screen_json['Name'] = 'renamed Screen' | ||
| _csrf_put_json(django_client, save_url, screen_json) | ||
|
|
||
| # Check screen has been updated and still has child Datasets |
| import pytest | ||
| from omero.gateway import BlitzGateway | ||
| from omero.model import ProjectI, DatasetI | ||
| from omero.model import ProjectI, DatasetI, TagAnnotationI |
| assert len(list(proj.listChildren())) == dataset_count | ||
|
|
||
| # Get Dataset, update and save back | ||
| dataset_url = reverse('api_dataset', |
There was a problem hiding this comment.
I split this test into 2
Projects/Datasets
Datasets/Images
There was a problem hiding this comment.
I'll use parametrize to split this into separate tests.
| assert dataset.getName() == 'renamed Dataset' | ||
| assert len(list(dataset.listChildren())) == image_count | ||
|
|
||
| def test_project_tags_update(self, user1): |
There was a problem hiding this comment.
This should be tested for other types too
There was a problem hiding this comment.
I assumed that Datasets and Screens behave the same way as Projects when being linked to Tags etc. But if we need to test them all, I can parametrize that test.
There was a problem hiding this comment.
Better to parametrize, we had surprises before
| # Therefore we ignore any details for now: | ||
| obj.unloadDetails() | ||
|
|
||
| # Unlink children for Projects, Datasets and Screens to avoid |
There was a problem hiding this comment.
Probably need a TODO so we can easily find it
and we need a card to review the graph round tripping since we will face it next round with image and roi saving for example
|
Card created at https://trello.com/c/DrXcE9cH/29-unloaded-objects-round-tripping |
Tests saving of Project with linked Dataset.
Following discussion at ome/omero-marshal#26 (review)
These tests highlight the discussed bug: If we load a Project without child Datasets, then update
the Project and save, all Datasets will get unlinked.
To fix this, we need to call
p.unloadDatasetLinks().Similar tests and logic added for updating of Datasets and Screens.
This now covers all objects that we allow to Save via the json api.
cc @chris-allan @emilroz @joshmoore