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

Add offset period aggregation type #1663

Merged
merged 4 commits into from
Nov 22, 2020
Merged

Conversation

kael89
Copy link
Collaborator

@kael89 kael89 commented Nov 20, 2020

Issue #:

[No issue] Required for PSSS indicators (eg https://github.com/beyondessential/tupaia-backlog/issues/1338), in order to calculate values for previous weeks (-1, -2 and -3 weeks) in comparison to the selected week

Copy link
Member

@edmofro edmofro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful implementation and tests

One thing to consider: we have a very similar config for specifying the default start and end dates of a dashboard report, but it uses unit rather than periodType, e.g.

"defaultTimePeriod": {"unit": "month", "offset": -1}

periodType is certainly more in keeping with the rest of the aggregation package, so I'm fine with the difference here, but just wanted to raise it.

@kael89 kael89 requested a review from edmofro November 22, 2020 22:56
@kael89
Copy link
Collaborator Author

kael89 commented Nov 22, 2020

Wonderful implementation and tests

One thing to consider: we have a very similar config for specifying the default start and end dates of a dashboard report, but it uses unit rather than periodType, e.g.

"defaultTimePeriod": {"unit": "month", "offset": -1}

periodType is certainly more in keeping with the rest of the aggregation package, so I'm fine with the difference here, but just wanted to raise it.

Thanks @edmofro ! Very good point. I'd be keen on using the same key on both instances, so let's keep this in mind for a potential future renaming

By the way, could you please review the commit I just pushed (I forgot to include a util introduced in another PR)?

@kael89 kael89 merged commit 6da7861 into dev Nov 22, 2020
@kael89 kael89 deleted the add-offset-period-aggregation-type branch November 22, 2020 23:16
@kael89 kael89 mentioned this pull request Nov 22, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants