Re: [asq-discuss] Executing a query more than once

19 views
Skip to first unread message

Robert Smallshire

unread,
Jun 8, 2013, 3:39:45 AM6/8/13
to asq-d...@googlegroups.com
Hi Jamie,

This isn't possible in the current version of asq. It's definitely something I want to address because several people have requested the same, it's also somewhat surprising behaviour in its current form because it's at divergence with LINQ for .NET.

This is essentially the same "bug" as this one,


I don't have a time scale for implementation, but I'll try to make an effort on this soon because it's clearly bothering quite a few people.

Rob


On 8 June 2013 04:18, <jamie....@gmail.com> wrote:
Hi

I'm wondering how to execute a query more than once?

>>> from asq.initiators import query
>>> l = [1,2,3,4]
>>> q = query(l).where(lambda x: x > 2)
>>> q.to_list()
[3, 4]
>>> q.to_list()
[]

For example, the first time to_list() is called [3,4] is returned, but when subsequent calls are made, empty results [] are returned . Is there some way of using the same query more than once? I noticed the same thing happens when you use a standard python filter.

Thanks for the cool library!

Jamie

--
You received this message because you are subscribed to the Google Groups "asq-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asq-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jamie....@gmail.com

unread,
Oct 17, 2013, 12:12:28 AM10/17/13
to asq-d...@googlegroups.com
I fixed it up so you can run queries more than once. I'll do a pull request.

jamie....@gmail.com

unread,
Oct 31, 2013, 8:49:40 PM10/31/13
to asq-d...@googlegroups.com
I made the fixes so you can run queries multiple times,  I pushed the changes into jamiediprose-asq: http://code.google.com/r/jamiediprose-asq/source/browse


On Saturday, June 8, 2013 7:39:45 PM UTC+12, Rob Smallshire wrote:
Reply all
Reply to author
Forward
0 new messages