新增 ForceComplete、UsingExactlyOnce 字段 - #365
Open
hcl00521 wants to merge 2 commits into
Open
Conversation
|
hcl01387923 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
wind1719
reviewed
Jul 22, 2026
|
|
||
|
|
||
| class ScheduledSQLConfiguration: | ||
| def __init__(self): |
Collaborator
There was a problem hiding this comment.
新字段未初始化,现有调用会在发请求前崩溃。 configurationToDict() 无条件读取两个新属性 (https://github.com/aliyun/aliyun-log-python-sdk/blob/fdae074dc616c03ebfb37591f9b9526d2dcb2539/aliyun/log/scheduled_sql.py#L88-L89),但 init() 没有初始化它们
(https://github.com/aliyun/aliyun-log-python-sdk/blob/fdae074dc616c03ebfb37591f9b9526d2dcb2539/aliyun/log/scheduled_sql.py#L49-L66)。因此任何没有同时调用两个新 setter 的旧代码,包括默认构造、只设置其中一个字段,以及从不含新字段的旧字典恢复配置,都会抛出
AttributeError。我已分别复现这三条路径。
建议在构造函数中初始化字段;官方示例响应中 forceComplete 的默认值是 False,可据此初始化 (https://help.aliyun.com/en/sls/developer-reference/get-scheduled-sql)。usingExactlyOnce
也应明确默认值,或未设置时不序列化。同时增加真正的单元测试,覆盖默认、部分设置和旧字典兼容路径。当前 e2e 任务只允许手动触发,PR 的常规 CI 不会执行它
(https://github.com/aliyun/aliyun-log-python-sdk/blob/fdae074dc616c03ebfb37591f9b9526d2dcb2539/.github/workflows/build.yaml#L75-L77)。
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.
No description provided.