-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: hogql tests should run through the query cleaning code to avoid flaps #25900
Conversation
@@ -31,8 +31,8 @@ | |||
FROM events LEFT JOIN ( | |||
SELECT person_static_cohort.person_id AS cohort_person_id, 1 AS matched, person_static_cohort.cohort_id AS cohort_id | |||
FROM person_static_cohort | |||
WHERE and(equals(person_static_cohort.team_id, 420), in(person_static_cohort.cohort_id, [6]))) AS __in_cohort ON equals(__in_cohort.cohort_person_id, events.person_id) |
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.
this for example was flapping pretty frequently on cohort id on unrelated changes for me
posthog/test/base.py
Outdated
query = re.sub(r"(team|cohort)_id(\"?) = \d+", r"\1_id\2 = 2", query) | ||
query = re.sub(r"\d+ as (team|cohort)_id(\"?)", r"2 as \1_id\2", query) |
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.
The only thing that feels weird here is that this replacement dummy value 2
look just like normal one 😅 whereas 0000000-0000-0000-0000-000000000000
seems obviously like a test placeholder. Something like 99999
would be more obvious (and 2
has been here before this PR, so I'm introducing scope creep)
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.
only a tiny bit of creep though
your wish is my command
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.
🤣 111 files changed 📈
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.
The large number of lines removed and added means this is extremely productive
this flapping test has bit me several times today
e1220f0
(#25898)and it's confusing to have sql snapshots that don't go through the sql snapshot cleaning code
we aren't using the query cleaning in hogql test sql snapshots, so we periodically flap the snapshots
flapping is slow
so we should avoid it