fix(azure): resolve mypy call-overload error on NIC creation - #532
Merged
blackboxsw merged 2 commits intoSep 17, 2026
Merged
Conversation
The Azure SDK types the `parameters` argument of `network_interfaces.begin_create_or_update` as a `NetworkInterface` model or raw bytes, while this module builds and passes an ARM-shaped dict. The call works at runtime, so narrow the ignore to that one overload error rather than changing what is sent. Fixes canonicalGH-531
blackboxsw
requested changes
Sep 16, 2026
blackboxsw
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for this submission and context related comment inline. I think what remains is bumping VERSION file so we can land this PR.
Contributor
Author
|
Bumped VERSION to 1!11.1.8. Thanks for the review! |
blackboxsw
approved these changes
Sep 17, 2026
blackboxsw
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, awaiting CI and then I'll merge this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
mypy pycloudlib examplesfails on one call:network_interfaces.begin_create_or_updateis typed to take aNetworkInterfacemodel orIO[bytes], while this module builds and passes the ARM-shaped dict the REST API expects. The call is fine at runtime, so this narrows the ignore to that single overload error instead of changing what is sent.I used
# type: ignore[call-overload]to match the ignores already used a few lines above (268-270) in the same method. As mentioned in #531, I also have acast(NetworkInterface, default_config)version ready —NetworkInterfaceis already imported here — so just say the word if you'd prefer that.Verified locally with the versions CI uses (mypy 2.3.1, azure-mgmt-network 32.0.0, ruff 0.5.0):
mypy pycloudlib/azure/instance.py— before: 1 error, after:Success: no issues foundruff check pycloudlib examples—All checks passed!ruff format --check pycloudlib examples— 64 files already formattedOne note on the issue text:
pycloudlib/gce/cloud.py:318is a mypy note, not an error — it comes fromcheck_untyped_defs = falsefor that module in the TODO override block — so this PR leaves it alone. Happy to drop that module from the override list in a separate PR if you want the bodies checked.I did not run the unit tests locally (that needs the full cloud dependency set); this change adds no runtime behavior, so I left them to CI.
Issues