Repository navigation
Use YYYY-MM strings for prevalence dates - #7
Merged
Merged
Conversation
Co-authored-by: david-mears-2 <60350599+david-mears-2@users.noreply.github.com>
david-mears-2
added this pull request to stack #6
September 11, 2026 14:32
Copilot created this pull request from a session on behalf of
david-mears-2
September 11, 2026 14:32
View session
Contributor
|
Verified that running the ./scripts/create_example_model_outputs.R and |
david-mears-2
requested changes
Sep 11, 2026
Co-authored-by: david-mears-2 <60350599+david-mears-2@users.noreply.github.com>
Co-authored-by: david-mears-2 <60350599+david-mears-2@users.noreply.github.com>
Co-authored-by: david-mears-2 <60350599+david-mears-2@users.noreply.github.com>
david-mears-2
force-pushed
the
copilot/poc-with-tests
branch
from
September 11, 2026 15:28
6b800b0 to
8a272d5
Compare
david-mears-2
marked this pull request as ready for review
September 18, 2026 16:28
david-mears-2
approved these changes
Sep 21, 2026
| const dateRegex = /^\d{4}-\d{2}-\d{2}$/; | ||
| const dateRegexes: Record<DateFormat, RegExp> = { | ||
| "YYYY-MM": /^\d{4}-(0[1-9]|1[0-2])$/, | ||
| "YYYY-MM-DD": /^\d{4}-\d{2}-\d{2}$/, |
There was a problem hiding this comment.
Up to you, but you could be as detailed on the month (and day!) regex for the daily format as for the monthly.
| }; | ||
|
|
||
| export const validateDateParams = (req: Request, res: Response): boolean => { | ||
| console.log("path:", req.path); |
| STRFTIME(MIN("date"), '%Y-%m-%d') AS min_date, | ||
| STRFTIME(MAX("date"), '%Y-%m-%d') AS max_date | ||
| MIN("date") AS min_date, | ||
| MAX("date") AS max_date |
There was a problem hiding this comment.
So you don't need to format the dates from the db here because they're now month strings rather than dates?
EmmaLRussell
approved these changes
Sep 30, 2026
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.
Model outputs (and hence prevalence responses) now represent monthly dates as
YYYY-MMstrings, to avoid the implication that the monthly prevalence applies to any particular day such as the 1st, and to free up the modelling team to aggregate monthly prevalence in any way they like (the implementation could vary by model release).AI use
As you can see in the commit history, Copilot did the first draft which I then tidied up.