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

fixed parameters query param for locations, countries, and providers … #308

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ cdk.out/
*.egg-info
.build
openaq_api/openaq_api/templates/*
openaq_api/openaq_api/static/assets/*
openaq_api/openaq_api/static/assets/*
.python-version
Pipfile
4 changes: 2 additions & 2 deletions openaq_api/openaq_api/v3/models/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class Paging(QueryBaseModel):

def pagination(self) -> str:
return "LIMIT :limit OFFSET :offset"


class ParametersQuery(QueryBaseModel):
"""Pydantic query model for the parameters query parameter
Expand All @@ -289,7 +289,7 @@ class ParametersQuery(QueryBaseModel):
def where(self) -> str | None:
""" """
if self.has("parameters_id"):
return "parameters_id = ANY (:parameters_id)"
return "parameter_ids && :parameters_id"


class MobileQuery(QueryBaseModel):
Expand Down
2 changes: 2 additions & 0 deletions openaq_api/openaq_api/v3/routers/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
MonitorQuery,
OwnerQuery,
Paging,
ParametersQuery,
ProviderQuery,
QueryBaseModel,
QueryBuilder,
Expand Down Expand Up @@ -69,6 +70,7 @@ class LocationsQueries(
Paging,
RadiusQuery,
BboxQuery,
ParametersQuery,
ProviderQuery,
OwnerQuery,
CountryIdQuery,
Expand Down
Loading