ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
20 stars 31 forks source link

Bug: getObjects() params ignores limit if offset is None #320

Closed will-moore closed 2 years ago

will-moore commented 2 years ago

Found by @erickmartins at https://github.com/ome/omero-gallery/pull/94

conn.getObjects() allows each ObjectWrapper to provide a params object, allowing filtering based on object properties. We use various attributes of the params provided in conn.getObject("Image", params) and apply these to the params from the ObjectWrapper (although we only handle pagination and ownerId).

However, the pagination (offset and limit) is only applied if BOTH are set:

https://github.com/ome/omero-py/blob/bf230dd4230215d91300f110f625a9a4adf3f5ee/src/omero/gateway/__init__.py#L3384

We should simply set offset and limit individually.