how do i get a count of bugs?

Asked by Martin Pool

I'd like to get eg the total number of bugs for a product. However, the obvious query fails:

len(project.searchTasks())
*** TypeError: collection size is not available

I guess I can iterate over all of the tasks and count them but that seems very inefficient for both of us.

Question information

Language:
English Edit question
Status:
Answered
For:
launchpadlib Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Edwin Grubbs (edwin-grubbs) said :
#1

Hi Martin,

It doesn't look getting the count of a collection is possible without loading all of it. The simplest solution would be to add a new method for getting the bug count, and I believe Deryck Hodge would be responsible for scheduling that.

Cheers,
Edwin

Revision history for this message
Edwin Grubbs (edwin-grubbs) said :
#2

Hi Martin,

Here is a bug related to why len() works for other collections but not for the return value of named operations.
https://bugs.edge.launchpad.net/launchpadlib/+bug/303414

Cheers,
Edwin

Can you help with this problem?

Provide an answer of your own, or ask Martin Pool for more information if necessary.

To post a message you must log in.