sqlobject is_empty and __nonzero__ are incorrect

Bug #659078 reported by Brad Crittenden on 2010-10-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
High
Gary Poster
Storm
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) on 2010-10-12
Changed in storm:
importance: Undecided → High
status: New → In Progress
milestone: none → 0.18
Jamu Kakar (jkakar) on 2010-10-12
Changed in storm:
status: In Progress → Fix Committed
Jamu Kakar (jkakar) on 2010-10-12
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
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
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) on 2010-10-25
Changed in launchpad-foundations:
assignee: nobody → Gary Poster (gary)
Changed in launchpad-foundations:
milestone: none → 10.11
tags: added: qa-needstesting
Changed in launchpad-foundations:
status: Triaged → Fix Committed
Gary Poster (gary) on 2010-10-26
Changed in storm:
status: Fix Committed → Fix Released
Gary Poster (gary) on 2010-10-28
tags: added: qa-untestable
removed: qa-needstesting
Curtis Hovey (sinzui) on 2010-11-17
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers