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

chore: Person ID overrides by default #22811

Merged
merged 62 commits into from
Sep 13, 2024
Merged

chore: Person ID overrides by default #22811

merged 62 commits into from
Sep 13, 2024

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Jun 7, 2024

Changes

Person-on-events cleanup:

  • person_id_override_properties_joined becomes the default in code (we can get rid of the persons-on-events-person-id-override-properties-joined flag after this)
  • Team.person_on_events_mode is now consistent with the project setting (which is based on Team.modifiers) – previously Team.person_on_events_mode didn't know about the project setting (although this only applies to projects where the setting was explicitly changed)
  • Got rid of the ancient person-on-events-enabled flag

@Twixes Twixes requested review from mariusandra, tiina303 and timgl June 7, 2024 14:16
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot

This comment was marked as outdated.

This comment was marked as outdated.

@posthog-bot

This comment was marked as outdated.

@posthog-bot

This comment was marked as outdated.

@posthog-bot

This comment was marked as outdated.

@tiina303 tiina303 requested a review from tkaemming June 11, 2024 12:10
Copy link
Contributor

@tiina303 tiina303 left a comment

Choose a reason for hiding this comment

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

lgtm, but I'm not the best reviewer for this & I didn't really check query .ambr changes

posthog/models/team/team.py Show resolved Hide resolved
@Twixes Twixes force-pushed the poe-rollout-2024 branch 2 times, most recently from dad46a7 to 12d4f97 Compare June 11, 2024 17:06
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

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

Changes look good, but seem incompatible with some tests, e.g:
image
image
image

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

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 stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

@posthog-bot posthog-bot closed this Jul 1, 2024
@Twixes Twixes reopened this Jul 18, 2024
@posthog-bot posthog-bot removed the stale label Jul 19, 2024
@posthog-bot
Copy link
Contributor

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 stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

@posthog-bot posthog-bot closed this Aug 5, 2024
Comment on lines +151 to +163
if ensure_analytics_event_in_session:
# Only importing from posthog.test.base if needed
from posthog.test.base import _create_event, flush_persons_and_events

# It's best to also create a random analytics event, since sessions querying does a JOIN with events in
# any person-ID-on-events mode - sessions without an analytics event are excluded
_create_event(
distinct_id=data["distinct_id"],
event="foobarino",
properties={"$session_id": data["session_id"]},
team_id=team_id,
)
flush_persons_and_events()
Copy link
Member Author

Choose a reason for hiding this comment

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

This turned out to be necessary, as the session recordings query works quite differently with PersonsOnEventsMode.DISABLED vs. with PersonsOnEventsMode.PERSON_ID_OVERRIDE_PROPERTIES_JOINED. CC @PostHog/team-replay for a sanity check

Copy link
Member

Choose a reason for hiding this comment

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

yep... we've got the laziest implementation possible right now.

i want to figure out how we can avoid having our own events query so we can just delegate completely

i guess we need to always select where session_id in (select $session_id from events where...) or something but am letting future me deal with that 🤣

@Twixes Twixes changed the title chore: Person IDs on events by default chore: Person ID overrides on events by default Sep 11, 2024
@Twixes Twixes changed the title chore: Person ID overrides on events by default chore: Person ID overrides by default Sep 11, 2024
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@anirudhpillai anirudhpillai left a comment

Choose a reason for hiding this comment

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

Someone from replay should cross check impact

Co-authored-by: Anirudh Pillai <[email protected]>
@@ -831,6 +831,7 @@ def test_rolling_retention(self):
_create_person(team_id=self.team.pk, distinct_ids=["person2"])
_create_person(team_id=self.team.pk, distinct_ids=["person3"])
_create_person(team_id=self.team.pk, distinct_ids=["person4"])
_create_person(team_id=self.team.pk, distinct_ids=["person5"])
Copy link
Member Author

Choose a reason for hiding this comment

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

Just a note that this test was off @aspicer

@Twixes Twixes enabled auto-merge (squash) September 13, 2024 16:18
@Twixes Twixes merged commit de3d95a into master Sep 13, 2024
93 checks passed
@Twixes Twixes deleted the poe-rollout-2024 branch September 13, 2024 16:40
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.

7 participants