Inconsistent SlackObjectFormationError raising when empty text is provided.
维护者通常 1 天内回复
@hello-ashleyintech 已经在做这个了。
开始于 2022年9月20日。
评估
这个 Issue 还没有评估数据。
描述
Given the following:
>>> SectionBlock(text="").to_dict()
SlackObjectFormationError: text or fields attribute must be specified
This is all correct enough and good enough. What's happening behind the scenes appears to be that TextObject.parse is used and does a truthy test on the incoming text, and returns None as opposed to an empty string.
Where that begins to go wrong, is here:
>>> SectionBlock(text=MarkdownTextObject(text="")).to_dict()
{'text': {'type': 'mrkdwn'}, 'type': 'section'}
Slack will reject that as erroneous. If it's sent back as part of the acknowledgement response as a response_action we won't necessarily see (receive) an error related to failing to parse the JSON schema. Slack's block kit builder says of it: Missing required field: text
Category
- slack_sdk.models (UI component builders)
Desired outcome
Ideally, I'd like to be able to trust (more) that the validation present in slack_sdk is going to raise on invalid configurations early, and consistently -- that is, where possible I'd like to assume that putting together something "empty" even if I've opted to use the classes instead of an equivalent base type (str, dict) should raise.
- 主要语言
- Python
- 星标
- 4k
- 派生
- 857
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 18
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slackapi/python-slack-sdk 的其他 Issue
-
needs info server-side-issue
难度 4/5 3-5 天 新手友好度 35/100
slackapi/python-slack-sdk#1961 · 3 条评论 ·
维护者通常 1 天内回复
-
auto-triage-skip discussion
难度 5/5 一周以上 新手友好度 35/100
slackapi/python-slack-sdk#1940 · 2 条评论 ·
维护者通常 1 天内回复
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel未关闭auto-triage-skip enhancement
难度 4/5 3-5 天 新手友好度 48/100
slackapi/python-slack-sdk#1923 · 2 条评论 ·
维护者通常 1 天内回复
-
auto-triage-skip bug python web-client
难度 3/5 1-2 天 新手友好度 52/100
slackapi/python-slack-sdk#1853 · 2 条评论 ·
维护者通常 1 天内回复
-
auto-triage-skip bug server-side-issue
难度 3/5 1-2 天 新手友好度 68/100
slackapi/python-slack-sdk#1847 · 5 条评论 ·
维护者通常 1 天内回复
查看 slackapi/python-slack-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
PedestrianDynamics/pyFDS-Evac#199 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
521xueweihan/HelloGitHub#3790 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
sandialabs/atlas-ui-3#978 ·
维护者通常 1 天内回复
-
area: tests perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 72/100
Nitjsefnie-Harness-Commons/daedalus#1255 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
EleutherAI/lm-evaluation-harness#4256 ·
维护者通常 1 天内回复