#179: Add date filters and grouping to volunteer application analytics#209
Open
Nishu2000-hub wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #179 — Phase 1
Adds independent date filtering to both charts in
volunteer_application_analytics.py.
Changes
filters for the activity trend chart (reads time_range,
start_date, end_date)
the location chart (reads time_range_location,
location_start_date, location_end_date)
for 7D/30D/Custom, monthly (YYYY-MM) for 1Y/All
three queries (new, active, cumulative)
date filter only, no grouping, country aggregation untouched
for testing all 5 time-range events
Necessary changes outside the specified functions
row['month'] — it merges the Virginia and Ireland trend results,
so leaving it unchanged would KeyError once the trend functions
emit 'period'
lambda_handler so the helpers can read the event
Testing
sql/ fixtures loaded into the Virginia schema. All 5 time-range
events return statusCode 200:
consistent (8→14→18→36→42→46)
totals drop 46→40, daily grouping confirmed
region without errors
event keys
Note for Phase 2
The Custom branch interpolates start_date/end_date directly into
SQL as specified in the issue. Since these arrive from the API
event, this is an injection vector — suggest switching to bound
parameters (like the existing country/skill filters) in Phase 2.
Edge case handled: Custom with a missing start or end date
degrades to no filter ("") instead of generating broken SQL.