Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter unexpected results #282

Open
Laia-g opened this issue Nov 14, 2019 · 1 comment
Open

Filter unexpected results #282

Laia-g opened this issue Nov 14, 2019 · 1 comment

Comments

@Laia-g
Copy link

Laia-g commented Nov 14, 2019

class Interpolated (StorageDict):
    '''
    @TypeSpec dict <<lat:double, ts:double>,fields_data:numpy.ndarray>
    '''

In [17]: list(filter(lambda x: x.lat == 89 and x.ts>0 and x.ts<0+6 , p))                                                                                                                                    
Out[17]: []

In [18]: list(filter(lambda x: x.lat == 89 and x.ts>0 and x.ts<6 , p))                                                                                                                                      
Out[18]: 
[row(key=row(lat=89.0, ts=1.0), value='20f01550-e7b8-4e45-9e3c-e80bcf0d28ad'),
 row(key=row(lat=89.0, ts=2.0), value='29759a4d-3657-4f35-ae46-78cd0f1d2f68'),
 row(key=row(lat=89.0, ts=3.0), value='7fccb60c-cab8-4b2b-aecf-801930d47b1f'),
 row(key=row(lat=89.0, ts=4.0), value='a0cfaa5c-005a-461b-becf-d4a44582b575'),
 row(key=row(lat=89.0, ts=5.0), value='7a437401-81c7-4b9d-9cd2-a61680d3adc1')]
@adrianespejo
Copy link
Collaborator

Our Cassandra filter only accepts simple lambdas, like the second one. If you pass a more complex lambda there can be unexpected results.
To use the in-memory python filter use python_filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants