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

added index to open_requests view #777

Merged
merged 2 commits into from
Aug 11, 2020
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 server/api/src/db/requests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def create():
status = 'Open' AND
latitude IS NOT NULL AND
longitude IS NOT NULL
) WITH DATA
) WITH DATA;

CREATE UNIQUE INDEX ON open_requests(srnumber);
""")


Expand Down
4 changes: 3 additions & 1 deletion server/api/src/pb/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def query(table, fields, filters):

if len(ncList) > 0:
district_filter = df['nc'].isin(ncList)
else:
elif len(cdList) > 0:
district_filter = df['cd'].isin(cdList)
else:
continue

batch = df.loc[(
(df['createddate'] > startDate) &
Expand Down