-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(ci): Fix mypy type errors across 6 files #21179
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
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -106,6 +106,7 @@ def validate_endpoint_configuration(self) -> "ZscalerAIGuardConfigModel": | |||||||
| ) | ||||||||
|
|
||||||||
| # Check for configuration issues | ||||||||
| assert api_base is not None # always set via env default above | ||||||||
|
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.
Using
Suggested change
|
||||||||
| is_resolve_policy = api_base.endswith("/resolve-and-execute-policy") | ||||||||
| is_execute_policy = api_base.endswith("/execute-policy") and not is_resolve_policy | ||||||||
|
|
||||||||
|
|
||||||||
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.
type: ignorehides potential misuseThe
# type: ignore[assignment]silences mypy but doesn't actually fix the underlying issue —RequestBodyis aTypedDictwith a fixed set of keys, and assigning arbitraryextra_bodykeys into it viadata_dict[k] = v(line 541) would still be incorrect from a type-safety perspective. The cast todictis just telling mypy to look away. A cleaner approach would be to usecast(dict, data)which is more explicit, or restructure to avoid the mismatch entirely. That said, this is a minor style concern and the runtime behavior is correct since TypedDicts are regular dicts at runtime.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!