-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(replay): support null filters on IPv4 #78642
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
Conversation
"None", | ||
"none", |
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.
I don't think these two should be special cases
Here are some examples of what the user can input, and what it looks like in the url/query param. Once it's in the url it becomes of type string
. By special casing "None"
and "none"
we're treating those string
values as equivalent to the string representation of pythons None
value.
If we special case these then they should be in the docs, because, especially in context of replay, our users are not all python users familiar with this keyword. It's a put dealing with upper & lower case characters and all this stuff.
So I don't think we should special case these at all.
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #78642 +/- ##
===========================================
+ Coverage 67.19% 78.13% +10.93%
===========================================
Files 7097 7102 +5
Lines 312692 312775 +83
Branches 51069 51085 +16
===========================================
+ Hits 210117 244388 +34271
+ Misses 95651 62014 -33637
+ Partials 6924 6373 -551 |
def visit_in(expression: Expression, value_list: list[str | None]) -> Condition: | ||
values = [Function("toIPv4", parameters=[v]) for v in value_list if v is not None] | ||
if None in value_list: | ||
return Or( |
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.
Not sure if it's ok to return snuba_sdk.conditions.Or/And
types here, instead of snuba_sdk.Condition
. Or if we should maybe add a type annotation.
Passes typecheck, but my IDE is complaining. Maybe mypy is skipping stuff for snuba_sdk. @cmanallen do you have any thoughts?
Same applies to the visit_in and visit_not_in in aggregate.py
…ig (#79054) Follow-up to #78642. Closes #78286 Because user.[ip, email, username, id] are nullable strings, and we aggregate the segments with `anyIf`, we can't use the row-by-row scalar config to filter on them. For the aggregate config, we need to handle the special case of null values. A replay's field is null if and only if all its segments have field = null. If you try the [user.email:""](https://sentry.sentry.io/replays/?cursor=0%3A0%3A1&project=11276&query=user.email%3A%22%22&statsPeriod=7d&utc=true) filter in sentry right now, and paginate results, you can see many replays with an email are returned. We might even be returning all of them.
Closes #78591