-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Always use person_distinct_id_override #22347
Conversation
I think the base commit of this PR is wrong, so the diff is much larger than it should be @timgl |
Size Change: +172 B (+0.02%) Total Size: 1.05 MB ℹ️ View Unchanged
|
300f387
to
f89b102
Compare
@Twixes done! |
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.
lgtm!
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.
Looks good to me, but results are different in a couple of tests, not sure why
This also looks good to me in general. I spent a bit of time trying to figure out what was going on with these tests, too. The issue with The other test failures are more confusing: I assumed they were because the overrides created in the tests were still being written to the old It seems like these tests are still using the legacy event query. When patched with: diff --git a/posthog/queries/event_query/event_query.py b/posthog/queries/event_query/event_query.py
index 49d4565a94..56ed872b81 100644
--- a/posthog/queries/event_query/event_query.py
+++ b/posthog/queries/event_query/event_query.py
@@ -134,6 +134,8 @@ class EventQuery(metaclass=ABCMeta):
return f"{self.DISTINCT_ID_TABLE_ALIAS}.person_id"
def _get_person_ids_query(self, *, relevant_events_conditions: str = "") -> str:
+ raise NotImplementedError("using legacy event query")
+
if not self._should_join_distinct_ids:
return ""
… running
Not sure what the plan is with updating or replacing these tests to use the new queries, but hopefully this saves some debugging time for you. Also, once we're not using this table in production queries any longer, I can take care of removing the override worker deployment and other plugin-server bits. |
Ah, all tests in |
You're right, and I misspoke here:
That change does fix something — the errors in To me that seems to suggest a discrepancy in test coverage between the old queries and the new queries (otherwise many more would have been broken here in this PR.) Seems like the tests that break with 55a3179 (the ones listed above) should either be ported to the new system, or deleted to unblock this? |
2a51e72
to
3946521
Compare
It looks like the code of |
@tkaemming I fixed the old queries so they use the new overrides too. |
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.
LGTM
Problem
For one version of PoE we were still using person_override instead of the correct person_distinct_id_override
Two types of people that would run into this
This will somewhat change data for these groups. I think this is acceptable as they opted in to this, and it's better to be correct. It will also reduce confusion for anyone now opting in to this, as the new settings don't explain the trade off the old settings did.
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?