Skip to content

新增 ForceComplete、UsingExactlyOnce 字段 - #365

Open
hcl00521 wants to merge 2 commits into
aliyun:masterfrom
hcl00521:feature/schedue_sql_exactly_hc
Open

新增 ForceComplete、UsingExactlyOnce 字段#365
hcl00521 wants to merge 2 commits into
aliyun:masterfrom
hcl00521:feature/schedue_sql_exactly_hc

Conversation

@hcl00521

Copy link
Copy Markdown
Contributor

No description provided.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.



class ScheduledSQLConfiguration:
def __init__(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新字段未初始化,现有调用会在发请求前崩溃。 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)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants