-
Notifications
You must be signed in to change notification settings - Fork 415
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
feat(analytics): Command to populate arbitrary periods of analytics data #4155
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Ignored Deployments
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4155 +/- ##
=======================================
Coverage 96.49% 96.50%
=======================================
Files 1175 1177 +2
Lines 38124 38191 +67
=======================================
+ Hits 36789 36856 +67
Misses 1335 1335 ☔ View full report in Codecov by Sentry. |
@@ -278,6 +278,74 @@ def test_populate_feature_evaluation_bucket_15m(freezer): | |||
assert buckets[7].total_count == 15 | |||
|
|||
|
|||
@pytest.mark.freeze_time("2023-01-19T09:00:00+00:00") | |||
@pytest.mark.django_db(databases=["analytics"]) | |||
def test_populate_feature_evaluation_bucket__upserts_buckets(freezer) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
freezegun
upgrade is blocked by restframework/django 4 upgrade, hence no type annotation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a minor typing comment
@@ -278,6 +278,74 @@ def test_populate_feature_evaluation_bucket_15m(freezer): | |||
assert buckets[7].total_count == 15 | |||
|
|||
|
|||
@pytest.mark.freeze_time("2023-01-19T09:00:00+00:00") | |||
@pytest.mark.django_db(databases=["analytics"]) | |||
def test_populate_feature_evaluation_bucket__upserts_buckets(freezer) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I wanted to add a comment here to add typing for the freezer
argument, but it looks as though it's type is perhaps Union[StepTickTimeFactory, TickingDateTimeFactory, FrozenDateTimeFactory]
(based on this and this) although, since we're not passing either of the tick
or auto_tick_seconds
arguments, I think the type is actually FrozenDateTimeFactory
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize this version of freezegun exports the type. Thanks! Updated annotations across the whole module.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
How did you test this code?
Added unit tests to verify upserts, and to verify the management command.