Skip to content

Fix bug multiple filters return no results multipleRange and others #2

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

Closed
wants to merge 2 commits into from

Conversation

Mrkisha
Copy link
Collaborator

@Mrkisha Mrkisha commented Dec 4, 2019

When Filter is used to fetch data, redis returns no results if filter params is not array.

@Mrkisha Mrkisha changed the title Fix bug multiple filter return no results Fix bug multiple filters return no results multipleRange and others Dec 4, 2019
@palicao
Copy link
Owner

palicao commented Dec 4, 2019

Thanks @Mrkisha, very good catch!
There is a problem: the function Filter::toRedisParams() is also used in 2 other places (TimeSeries::getLastSamples() and TimeSeries::getKeysByFilter()), you should update it also there and prepare the arguments using array_merge().
Also it would be great if you could also write the related integration tests (otherwise I'll do it later, no problem!)

Comment on lines 80 to 83
null,
null,
null,
null
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are not needed, apart from the first, all the other parameters have default value = null.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to be explicit about it. But I'll remove it.

@Mrkisha
Copy link
Collaborator Author

Mrkisha commented Dec 4, 2019

Thanks @Mrkisha, very good catch!
There is a problem: the function Filter::toRedisParams() is also used in 2 other places (TimeSeries::getLastSamples() and TimeSeries::getKeysByFilter()), you should update it also there and prepare the arguments using array_merge().
Also it would be great if you could also write the related integration tests (otherwise I'll do it later, no problem!)

I've took care of these in tests. Check TimeSeriesTest tests.

@palicao
Copy link
Owner

palicao commented Dec 4, 2019

@Mrkisha the problem is that TimeSeries::getLastSamples() and TimeSeries::getKeysByFilter() will break if we merge those changes.
I am creating a branch which fixes the problem in the whole library.

@palicao
Copy link
Owner

palicao commented Dec 5, 2019

Closing because solved in #3

@palicao palicao closed this Dec 5, 2019
@Mrkisha Mrkisha deleted the feature/fix-filter branch December 5, 2019 08:21
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

Successfully merging this pull request may close these issues.

3 participants