Inconsistent SlackObjectFormationError raising when empty text is provided.
Maintainer antworten meist innerhalb von 5 Tagen
@hello-ashleyintech arbeitet bereits daran.
Seit 20.9.2022.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 4k
- Forks
- 861
- Ø Merge
- 3 T. 17 Std.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus slackapi/python-slack-sdk
-
Missing method from SDK // admin.users.getExpirationEvtl. vergeben @srtaalej hat das vor 3 Tagen übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
slackapi/python-slack-sdk#1982 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 5 Tagen
-
auto-triage-stale needs info server-side-issue
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
slackapi/python-slack-sdk#1961 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 5 Tagen
-
auto-triage-skip discussion
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
slackapi/python-slack-sdk#1940 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 5 Tagen
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channelOffenauto-triage-skip enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
slackapi/python-slack-sdk#1923 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 5 Tagen
-
files_upload_v2 should respect the retry handlersEvtl. vergeben @DSeaStar hat das vor 59 Tagen übernommen. Offenauto-triage-skip bug python web-client
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
slackapi/python-slack-sdk#1853 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 5 Tagen
Alle Issues in slackapi/python-slack-sdk
Ähnliche Issues
-
SSM GetParameter throttling during concurrent workflow launchesEvtl. vergeben @alexiswl hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
-
[Bug] Dev image build fails: `npm install` in the root Dockerfile runs out of memory (exit 134)Evtl. vergeben @andest01 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
pesu-dev/discord_bot#97 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
gradio-app/gradio#13964 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 93/100
BSData/horus-heresy-3rd-edition#3232 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag