Skip to content

feat: support filtering fields in correlation, trend, and backfill #525

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

Merged
merged 1 commit into from
May 6, 2021
Merged
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
8 changes: 4 additions & 4 deletions src/server/endpoints/covidcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
parse_single_time_arg,
parse_single_geo_arg,
)
from .._query import QueryBuilder, execute_query, run_query, parse_row
from .._query import QueryBuilder, execute_query, run_query, parse_row, filter_fields
from .._printer import create_printer, CSVPrinter
from .._validate import (
extract_date,
Expand Down Expand Up @@ -200,7 +200,7 @@ def gen(rows):
raise DatabaseErrorException(str(e))

# now use a generator for sending the rows and execute all the other queries
return p(gen(r))
return p(filter_fields(gen(r)))


@bp.route("/correlation", methods=("GET", "POST"))
Expand Down Expand Up @@ -260,7 +260,7 @@ def gen():
yield cor.asdict()

# now use a generator for sending the rows and execute all the other queries
return p(gen())
return p(filter_fields(gen()))


@bp.route("/csv", methods=("GET", "POST"))
Expand Down Expand Up @@ -405,7 +405,7 @@ def gen(rows):
raise DatabaseErrorException(str(e))

# now use a generator for sending the rows and execute all the other queries
return p(gen(r))
return p(filter_fields(gen(r)))


@bp.route("/meta", methods=("GET", "POST"))
Expand Down