-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: Date range generation for persons_urls #11468
Closed
Closed
Conversation
This file contains 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
pauldambra
reviewed
Aug 31, 2022
ee/clickhouse/queries/test/__snapshots__/test_breakdown_props.ambr
Outdated
Show resolved
Hide resolved
# Conflicts: # posthog/api/test/test_persons_trends.py # posthog/queries/trends/breakdown.py # posthog/queries/trends/total_volume.py
# Conflicts: # ee/clickhouse/queries/test/test_event_query.py # ee/clickhouse/queries/test/test_trends.py # posthog/api/test/test_persons_trends.py # posthog/queries/test/test_trends.py
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
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.
Problem
Closes #11466
Might close #11352
Might close #9565
Related to #11492
Persons URLs with timezone offsets were not working. This attempts to fix this by ensuring the date_from and date_to params are set accurately and are respected by the persons endpoint.
NOTE This is a bit tricky and should be looked at carefully. A few things were happening that causes some unexpected results
date_to
param by default to be the "end of the day" if the interval is anything other than an hour.date_from=2022-08-20T22:00:00Z&date_to=2022-08-21T22:00:00Z
(2022-08-21
UTC+2) will have thedate_to
modified to2022-08-21T23:59:59Z
(naively the end of the day) which is now a 26 hour window rather than 24date_to
the same asdate_from
in thepersons_urls
which would work for UTC (it would get bumped to 23:59:59 that day) but breaks for any non-utc timezones (which explains many reports of wrong numbers in the persons modal). This is most noticeable by UTC+N timezones rather than UTC-N timezones.I think we should not override the
date_to
param but rather respect it always. This waydate_from
+date_to
pair takes precedence withinterval
only used for bucketingChanges
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
How did you test this code?
Some tests but more should really be added to cover these edge-casey timezone issues
TODO: