Enable developers to inject non-bolt arguments to listener function args
@seratch がすでに取り組んでいます。
2022年8月25日 から。
評価
この issue はまだ評価されていません。
説明
I'm using dependency_injector to provide automatic dependency injection for my application, and I'm encountering an issue with Bolt overriding injected parameters with None since it doesn't recognize them.
Reproducible in:
pip freeze | grep slack
python --version
sw_vers && uname -v # or `ver`
The slack_bolt version
slack-bolt==1.14.3
slack-sdk==3.18.1
Python runtime version
Python 3.10.6
OS info
ProductName: macOS
ProductVersion: 12.5.1
BuildVersion: 21G83
Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
- Have a kwarg that is populated by some mechanism other than bolt (such as another decorator), e.g.
@app.command('/ping')
@inject
async def handle_ping(ack, respond, version: str = Provide[Container.config.VERSION]):
await ack()
await respond({
"blocks": [
SectionBlock(text=MarkdownTextObject(text='Pong!')),
DividerBlock(),
ContextBlock(elements=[
MarkdownTextObject(text=f'*Host:* {platform.node()}'),
MarkdownTextObject(text=f'*Version:* {version}')
])
]
})
Expected result:
Bolt doesn't touch the version kwarg, but still injects the ack and respond kwargs.
Actual result:
version ends up being set to None and Bolt logs the following warning: version is not a valid argument.
This is caused by this line.
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
- 主要言語
- Python
- スター
- 1.3k
- フォーク
- 288
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/bolt-python のほかの issue
-
docs enhancement server-side
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
slackapi/bolt-python#1576 · コメント 1 件 ·
-
auto-triage-skip bug security semver:major
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
slackapi/bolt-python#1447 · コメント 9 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
slackapi/bolt-python#1577 ·
-
area:async auto-triage-skip dependencies
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
slackapi/bolt-python#1472 · コメント 1 件 · リアクション 1 件 ·
-
auto-triage-skip enhancement
slackapi/bolt-python#1346 · コメント 2 件 · 担当者 1 名 ·
slackapi/bolt-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·