Inconsistent SlackObjectFormationError raising when empty text is provided.
@hello-ashleyintech ya está trabajando en esto.
Desde el 20/9/2022.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 4k
- Forks
- 857
- Merge medio
- 22 h 21 min
- PR fusionados (30 d)
- 16
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de slackapi/python-slack-sdk
-
needs info server-side-issue
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
slackapi/python-slack-sdk#1961 · 3 comentarios ·
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards Abiertoauto-triage-skip bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
slackapi/python-slack-sdk#1940 · 2 comentarios ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel Abiertoauto-triage-skip enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
slackapi/python-slack-sdk#1923 · 2 comentarios ·
-
SocketModeClient.connect() retries forever against a permanently closed aiohttp ClientSession Abiertoauto-triage-skip bug socket-mode
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
slackapi/python-slack-sdk#1922 · 2 comentarios ·
Todos los issues de slackapi/python-slack-sdk
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stephrobert/dsoxlab#238 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sublimehq/package_control#1780 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
nwg-piotr/nwg-displays#145 ·