-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref: fix some types for sentry.issues #72813
Conversation
@@ -70,7 +72,7 @@ def get( | |||
).values_list("id", flat=True) | |||
) | |||
|
|||
union_qs = Activity.objects.none() | |||
union_qs = Activity.objects.none().values_list("id", flat=True) |
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 convinces mypy the type is QuerySet[Activity, int]
@@ -110,6 +110,7 @@ def post(self, request: Request, organization: Organization) -> Response: | |||
sort=result["sort"], | |||
visibility=result["visibility"], | |||
) | |||
assert saved_search.type is not 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.
wouldn't it be better to check result["type"] in the validator? so we can return a proper http 400
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.
it is checked there -- but the model can do some defaulting on type
so I have to check it here as well
technically the database schema is wrong (it should be NOT NULL
for that column) but fixing that is a lot more involved
No description provided.