fix(ecs): correct type hints for DescribeInstances request#43
Open
ethreal798 wants to merge 1 commit into
Open
fix(ecs): correct type hints for DescribeInstances request#43ethreal798 wants to merge 1 commit into
ethreal798 wants to merge 1 commit into
Conversation
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.
Bug 修复说明
修复了
DescribeInstances接口的 SDK 类型提示错误以及提出 API 官方文档中的参数描述错误。1. SDK 代码修复 (Type Hint)
问题现象:
当前 SDK 中
DescribeInstances方法的类型注解不准确,导致 PyCharm 的静态检查器报错。具体表现:
传入
InstanceIds列表时,IDE 提示类型不匹配,期望str但收到List[str]],Expected type 'str | None', got 'list[str]' instead修复方案:
修正了
_describe_instances_request.py文件中DescribeInstancesRequest类的类型定义,使其符合实际 API 规范。2. 文档修正建议 (API DOC)
发现问题:
在核对代码时,我发现官方 API [https://api.aliyun.com/api/Ecs/2014-05-26/DescribeInstances?tab=DOC] 文档中的参数描述存在误导或错误。
具体位置:
InstanceIds(位于请求参数表格中)InstanceIds类型标记为string测试验证