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

Add support for passing a list to filters in list_measurements #929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hynnot
Copy link
Contributor

@hynnot hynnot commented Jan 27, 2025

This PR is about the issue #795

Steps:

  • Changes to accept the following filters as lists (domain, test_name, probe_cc, probe_asn)

Notes:

  • Fix a problem with scores type.
  • Fix a problem with the input variable.

@hynnot hynnot requested a review from hellais January 27, 2025 15:29
@hynnot hynnot force-pushed the add-support-for-passing-a-list-to-filters branch from 4b889a7 to d4398d9 Compare January 28, 2025 09:43
@hynnot hynnot marked this pull request as ready for review January 28, 2025 09:47

def test_list_measurements_with_multiple_values_to_filters_not_in_the_result(client):
params = {
"domain": "cloudflare-dns.com, adblock.doh.mullvad.net, 1.1.1.1",
Copy link
Member

@hellais hellais Jan 28, 2025

Choose a reason for hiding this comment

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

Isn't this not returning values because the domain parameters have extra whitespace after them?

That is the filter will turn out to be domain = ['cloudflare-dns.com', ' adblock.doh.mullvad.net', ' 1.1.1.1'] (notice the extra leading whitespace)

I think it would be more clear to use a test that includes some domains that clearly do not exist in the result set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The name of the test is the confusion here. We don't return the field domain in the result, this is why I can check the value (maybe this is an error and we should return it) About the whitespace it's not a problem because the split function removes them.

About the second comment, I can add a domain not in our data because the result is the same. The list is an OR list.

Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think you can merge it when the issue with one of the tests is addressed.

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.

2 participants