Static external IP sample entry point passes invalid keyword arguments
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with compute/client_library/recipes/instances/ip_address/assign_static_external_ip_to_new_vm.py and its generated counterpart at compute/client_library/snippets/instances/ip_address/assign_static_external_ip_to_new_vm.py. Inspect the command-line entry point and run the reported mypy check or sample to confirm the call uses the function's accepted argument; done means the generated sample no longer reports the keyword errors and can run past argument validation.
Written by the indexing model from the issue text.
Description
In which file did you encounter the issue?
compute/client_library/recipes/instances/ip_address/assign_static_external_ip_to_new_vm.pycompute/client_library/snippets/instances/ip_address/assign_static_external_ip_to_new_vm.py
Did you change the file? If so, how?
No.
Describe the issue
The command-line entry point calls assign_static_external_ip_to_new_vm with external_ipv4 and external_access keyword arguments, but the function accepts a single ip_address argument. The generated snippet and its source recipe contain the same incorrect call.
Static reproduction:
compute\\client_library\\snippets\\instances\\ip_address\\assign_static_external_ip_to_new_vm.py:313: error: Unexpected keyword argument "external_ipv4" for "assign_static_external_ip_to_new_vm" [call-arg]
compute\\client_library\\snippets\\instances\\ip_address\\assign_static_external_ip_to_new_vm.py:313: error: Unexpected keyword argument "external_access" for "assign_static_external_ip_to_new_vm" [call-arg]
At runtime, the call raises TypeError: assign_static_external_ip_to_new_vm() got an unexpected keyword argument 'external_ipv4' before the instance is created.
Expected behavior: the sample entry point passes the pre-created address as ip_address. Actual behavior: the generated sample cannot run.
Environment: Python 3.12, mypy 1.14.1, repository main at commit 430a87ada6f2d33f318b5d16b77464679905a140.
- Dominant language
- Jupyter Notebook
- Stars
- 8.1k
- Forks
- 6.7k
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GoogleCloudPlatform/python-docs-samples
-
samples
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
samples
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
samples
GoogleCloudPlatform/python-docs-samples#14117 · 1 assignee ·
-
samples
GoogleCloudPlatform/python-docs-samples#14091 · 1 assignee ·
-
samples
Difficulty 4/5 3-5 days Newbie friendliness 30/100
GoogleCloudPlatform/python-docs-samples#13734 · 4 comments ·
All issues in GoogleCloudPlatform/python-docs-samples
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
canonical/postgresql-watcher-operator#111 · 2 comments ·