Skip to content

Paths to object well image fix#4933

Merged
jburel merged 4 commits intoome:developfrom
will-moore:paths_to_object_wellImage_fix
Dec 15, 2016
Merged

Paths to object well image fix#4933
jburel merged 4 commits intoome:developfrom
will-moore:paths_to_object_wellImage_fix

Conversation

@will-moore
Copy link
Copy Markdown
Member

@will-moore will-moore commented Nov 10, 2016

What this PR does

This fixes a bug found during IDR testing today and reproduced on develop:
https://www.openmicroscopy.org/qa2/qa/feedback/17421/
Introduced in #4774

To reproduce / test:

  • Need to have more than 200 (1 page) of orphaned images (so that orphaned images are paginated)
  • Search for an Image that is in a Well
  • In search results, select image and expand the Tables panel to the right (NB: don't need to have any Tables data).
  • This makes a call to webclient/api/paths_to_object/?image=ID which previously failed if the image is in a Well (not orphaned) AND there are more than 1 page of orphaned images.
  • With this fix, should get no error when Tables panel is expanded.
  • Also, test that going to webclient/api/paths_to_object/?image=ID for the Image in Well returns json that includes the WellID

Check that orphaned pagination still works

  • Browse to orphaned images and pick an image that is on page 2 (or more).
  • Copy the link to it, paste into browser and check you are returned to the correct page of orphaned images and image is selected.
  • Also can check that webclient/api/paths_to_object/?image=ID for this image has correct pagination details returned.

The bug was because we try to find the index of orphaned image in list of ALL orphaned images (to know which page it is on) BEFORE checking whether the image is in a Well.
This was also very slow on IDR because it has > 10,000 orphaned images.

Now, we only try to load ALL orphaned images to find page AFTER we've checked to see if image is in a Well.

cc @joshmoore @aleksandra-tarkowska @manics

@atarkowska
Copy link
Copy Markdown
Member

--rebased-to #4934

@pwalczysko
Copy link
Copy Markdown
Member

All checks have passed.
The json output in the image-in-the-well case shows that the image is in the well
screen shot 2016-11-11 at 10 30 55

The json output in the orphaned-image-on-second-page shows that the image is on second page
screen shot 2016-11-11 at 10 35 48

@pwalczysko
Copy link
Copy Markdown
Member

Ready to merge fmpov.

@jburel jburel added the develop label Nov 12, 2016
@jburel
Copy link
Copy Markdown
Member

jburel commented Nov 15, 2016

could you please add tests to test_show.py?

@will-moore will-moore closed this Nov 17, 2016
@will-moore will-moore reopened this Nov 17, 2016
@atarkowska
Copy link
Copy Markdown
Member

@will-moore as #4934 was merged could you rebase last commit please

@mtbc
Copy link
Copy Markdown
Member

mtbc commented Nov 23, 2016

Is the test outcome reported in CI anywhere?

@will-moore
Copy link
Copy Markdown
Member Author

@mtbc
Copy link
Copy Markdown
Member

mtbc commented Nov 23, 2016

Aha, thank you! I was confused through not seeing it at https://ci.openmicroscopy.org/job/OMERO-DEV-merge-integration-Python/lastCompletedBuild/testReport/.

Copy link
Copy Markdown
Member

@chris-allan chris-allan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on past experience, I'm fairly concerned here about the number of objects that are being joined in the WellSample-Well-Plate-Screen hierachy being queried. This query has the potential of taking many seconds to return and should be evaluated, potentially in isolation, on a Plate and/or Screen of realistic size.

/cc @joshmoore, @aleksandra-tarkowska, @jburel

from WellSample wellsample
left outer join wellsample.details.owner wsowner
left outer join wellsample.plateAcquisition acquisition
left outer join wellsample.details.owner aowner
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same object wellsample.details.owner is being applied to two separate aliases (wsowner and aowner) here. As details are always present and the base of your JOINs is wellsample you also don't need left outer here.

Maybe add a failing test case for this condition and then fix the bug? Or is this just completely irrelevant and can be removed from the query?

left outer join wellsample.plateAcquisition acquisition
left outer join wellsample.details.owner aowner
join wellsample.well well
left outer join well.plate plate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plate is a required element of well as is details as above so do not need to be left outer joined.

@atarkowska
Copy link
Copy Markdown
Member

atarkowska commented Nov 30, 2016

@chris-allan this PR is fixing the issue where unnecessarily image in the well were tested as an orphaned image. @will-moore changed the order of the logic identifying images in a well. HQL contently needs improvement as you pointed out, but lets not block this PR as there are no changes to HQL. We will review that in a following up PR to keep it inline with metadata52 branch. Would that be ok with you?

@chris-allan
Copy link
Copy Markdown
Member

Completely understood, @aleksandra-tarkowska. Your call on the scope, I don't have enough visibility there.

@atarkowska
Copy link
Copy Markdown
Member

@will-moore
Copy link
Copy Markdown
Member Author

I'm happy to fix queries in this PR, then when this is merged we can rebase to IDR all the commits missing from #4934 (this already includes one commit: 103e87f)

Alternatively this could be merged as is and queries improved in subsequent PR?

@chris-allan
Copy link
Copy Markdown
Member

Either option is fine from my perspective.

@will-moore
Copy link
Copy Markdown
Member Author

@chris-allan A sample query from IDR http://idr-demo.openmicroscopy.org/webclient/api/paths_to_object/?image=696619 takes about 150 ms (even with a cache-busting ?_=random)

@chris-allan
Copy link
Copy Markdown
Member

That's pretty reasonable then @will-moore.

@will-moore
Copy link
Copy Markdown
Member Author

Let's fix queries in another PR, since we now have a trello card for that. Smaller PRs are generally best!

@jburel
Copy link
Copy Markdown
Member

jburel commented Dec 15, 2016

@chris-allan: any more comments? since the "red" change requested is still on

@jburel jburel merged commit e9bb356 into ome:develop Dec 15, 2016
@jburel jburel added this to the 5.3.0 milestone Mar 29, 2017
@will-moore will-moore deleted the paths_to_object_wellImage_fix branch February 18, 2019 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants