sqlobject is_empty and __nonzero__ are incorrect

Bug #659078 reported by Brad Crittenden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Gary Poster
Storm
Fix Released
High
Jeroen T. Vermeulen

Bug Description

The implementation for is_empty is currently:

    def is_empty(self):
        """Return C{True} if this result set doesn't contain any results."""
        result_set = self._without_prejoins()._result_set
        return not result_set.is_empty()

The 'not' shouldn't be there.

Also note that __nonzero__ is currently wrong but produces correct results. It will break when is_empty is fixed.

So, simply recycle the 'not' from is_empty and donate it to __nonzero__.

Related branches

Jamu Kakar (jkakar)
Changed in storm:
importance: Undecided → High
status: New → In Progress
milestone: none → 0.18
Jamu Kakar (jkakar)
Changed in storm:
status: In Progress → Fix Committed
Jamu Kakar (jkakar)
Changed in storm:
assignee: nobody → Jeroen T. Vermeulen (jtv)
status: Fix Committed → In Progress
Changed in storm:
status: In Progress → Fix Committed
affects: rosetta → launchpad
affects: launchpad → launchpad-foundations
Revision history for this message
Gary Poster (gary) wrote :

I've asked Jamu for an estimate on when 0.18 might be out. I expect not soon, in which case we'll either merge this back into our 0.17 branch or move to Storm's trunk (Robert mentioned a bug on trunk to avoid earlier, so I'd need to get the details on that before proceeding).

Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Gary Poster (gary) wrote :

Jamu reports that he's happy to make a release of 0.18 soon. He also asked if we in LP would be willing to help out with releases, and I said I'd be happy to; we may make the 0.18 release ourselves.

That said, bug 620615 is a blocker for LP's usage. If that can't be addressed soon, we'll merge this fix back to our 0.17 branch instead and make a local release.

Gary Poster (gary)
Changed in launchpad-foundations:
assignee: nobody → Gary Poster (gary)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
Changed in launchpad-foundations:
milestone: none → 10.11
tags: added: qa-needstesting
Changed in launchpad-foundations:
status: Triaged → Fix Committed
Gary Poster (gary)
Changed in storm:
status: Fix Committed → Fix Released
Gary Poster (gary)
tags: added: qa-untestable
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.