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 space to the end of filter conditions in the query #8

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

alex9smith
Copy link
Owner

Fixes #6

Previously only the first filter condition in the query was applied. Due
to the order in which filters are constructed, this was usually keyword.

Someone making a search with

f = Filters(
    keyword = "paypal",
    timespan = "7d",
    theme = "TAX_ECON_PRICE"
)

would get the same results as someone using

f = Filters(
    keyword = "paypal",
    timespan = "7d"
)

which is incorrect.

This is because the API needs a space between each of the filter conditions
in the query.

Add a space at the end of every filter condition when constructing the
query string. I have tested and the API returns the same results if a
space is at the end of a query with only a single condition, ie.

f = Filters(
    keyword = "paypal",
    timespan = "7d"
)

and

f = Filters(
    keyword = "paypal ",
    timespan = "7d"
)

have the same results, so it is safe to always add the space in.

Also add a changelog so it's easy to keep track of what's happening when a new version is released.

Fixes #6

Previously only the first filter condition in the query was applied. Due
to the order in which filters are constructed, this was usually `keyword`.

Someone making a search with

```
f = Filters(
    keyword = "paypal",
    timespan = "7d",
    theme = "TAX_ECON_PRICE"
)
```

would get the same results as someone using

```
f = Filters(
    keyword = "paypal",
    timespan = "7d"
)
```

which is incorrect.

This is because the API needs a space between each of the filter conditions
in the query.

Add a space at the end of every filter condition when constructing the
query string. I have tested and the API returns the same results if a
space is at the end of a query with only a single condition, ie.

```
f = Filters(
    keyword = "paypal",
    timespan = "7d"
)
```

and

```
f = Filters(
    keyword = "paypal ",
    timespan = "7d"
)
```

have the same results, so it is safe to always add the space in.
@alex9smith alex9smith merged commit 1b82072 into master Nov 3, 2021
@alex9smith alex9smith deleted the fix-filters branch November 4, 2021 20:11
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.

Filters don't work
1 participant