-
Notifications
You must be signed in to change notification settings - Fork 562
feat(Segment Membership): Skip traitless identities when seeding #8455
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,9 @@ def seed_organisation_identities(organisation_id: int) -> None: | |
|
|
||
| Rows are versioned at scan start via `inserted_at` | ||
| so writes arriving mid-scan win ReplacingMergeTree dedup over the seeded row. | ||
|
|
||
| Identities carrying no traits at all are skipped, keeping the mirror off the | ||
| large populations of empty identities some environments accumulate. | ||
| """ | ||
| log = logger.bind(organisation__id=organisation_id) | ||
| if not settings.CLICKHOUSE_ENABLED: | ||
|
|
@@ -104,7 +107,13 @@ def seed_organisation_identities(organisation_id: int) -> None: | |
| scan_started_at, | ||
| ) | ||
| for doc in batch | ||
| # An identity with nothing on it can only match | ||
| # a segment by percentage split or `is not set`. | ||
|
Comment on lines
+110
to
+111
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I don't see how this comment warrants skipping identities. As I see, both percentage split and |
||
| if doc.get("identity_traits") | ||
| or doc.get("system_traits") | ||
| ] | ||
| if not rows: | ||
| continue | ||
| # Django's CursorWrapper stub forbids dicts in | ||
| # the params sequence; clickhouse-driver accepts | ||
| # them as JSON-column payloads. | ||
|
|
||
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.
Deixis. If we need to mention a temporary context, consider adding a TODO pointing to an issue in which we discuss stop persisting ephemeral identities.