Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Static external IP sample entry point passes invalid keyword arguments

未关闭 适合新手
#14,611 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
gcp, python
领域
cloud

调研方向

从 compute/client_library/recipes/instances/ip_address/assign_static_external_ip_to_new_vm.py 及其位于 compute/client_library/snippets/instances/ip_address/assign_static_external_ip_to_new_vm.py 的生成对应文件开始。检查命令行入口点,并运行报告的 mypy 检查或示例,以确认调用使用了函数接受的参数;当生成的示例不再报告 keyword 错误,并且能够通过参数验证继续运行时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

samples

In which file did you encounter the issue?

  • compute/client_library/recipes/instances/ip_address/assign_static_external_ip_to_new_vm.py
  • compute/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.

主要语言
Jupyter Notebook
星标
8.1k
派生
6.7k
平均合并
4 天 4 小时
30 天内合并 PR
8

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GoogleCloudPlatform/python-docs-samples 的其他 Issue

查看 GoogleCloudPlatform/python-docs-samples 的全部 Issue

相似的 Issue

更多 Cloud Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。