Task #7889 (closed)
Opened 13 years ago
Closed 12 years ago
Bug: None has no attribute parent
Reported by: | jamoore | Owned by: | wmoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4 |
Component: | OmeroPy | Version: | n.a. |
Keywords: | gateway | Cc: | python-team@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
None returned from experimenter.copyGroupExperimenterMap() when the data in the DB looks like this:
select * from groupexperimentermap where child = 5; id | permissions | owner | version | child | external_id | parent | child_index ----+-------------+-------+---------+-------+-------------+--------+------------- 12 | -103 | f | 0 | 5 | | 1 | 1 (1 row)
i.e. when there's a null in the list of groups.
Request Method: GET Request URL: http://localhost:8080/webadmin/experimenters/ Django Version: 1.3.1 Exception Type: AttributeError Exception Value: 'NoneType' object has no attribute 'parent' Exception Location: /private/tmp/sprint7/dist/lib/python/omero/gateway/__init__.py in isActive, line 3967
Change History (6)
comment:1 Changed 12 years ago by wmoore
comment:2 Changed 12 years ago by jmoore
That collection is ordered. If for whatever reason there's a gap in the ordering, Hibernate will convert that to a None in the list. In theory, though, that shouldn't be happening and we should figure out how the null got there.
comment:4 Changed 12 years ago by wmoore
- Owner changed from wmoore to jmoore
This commit should fix the Bug above https://github.com/will-moore/openmicroscopy/commit/988559feb14136947a325c3f74dda0ee453fbe65
but if we generally can't be sure that retrieving an ordered collection won't have items that are None, then there are a ton of places where we'd need to add that similar checks. Seems to me that it would be a lot nicer if the server could filter out any None values from results before returning to clients.
comment:5 Changed 12 years ago by jmoore
- Owner changed from jmoore to wmoore
Sorry, Will. Impossible. The nulls are part of the contract. An ordered collection can by definition have blanks in it. There's no way to strip them out without having the ordering destroyed in the DB. (Imagine a missing well from a plate. It would shift position)
comment:6 Changed 12 years ago by wmoore
- Resolution set to fixed
- Status changed from new to closed
This bug is fixed by the commit above. Fixing this problem in general is a new ticket: #9140. Closing...
I can easily add a check for None when iterating through the links, but not sure why you'd get a None from that query?