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

feat(replay): support null filters on IPv4 #78642

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Oct 4, 2024

Closes #78591

@aliu39 aliu39 requested a review from a team as a code owner October 4, 2024 19:36
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 4, 2024
Comment on lines 11 to 12
"None",
"none",
Copy link
Member

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.

SCR-20241004-lmsw
SCR-20241004-lmvb
SCR-20241004-lmxb

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...try/replays/usecases/query/conditions/aggregate.py 71.42% 4 Missing ⚠️
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(
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Replay Search] Support null/empty queries for IP field.
3 participants