-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documention for injected 'args' param option #835
Conversation
Is the lack of documentation intentional? kwarg injection allows the best practice of YAGNI so that you can choose exactly which arguments are needed in each use case rather than always having a bunch of args that are (potentially; often) never used. Similarly, a function that calls out its arguments is more clear and follows the Python zen that Explicit is better than implicit as well as Readability counts. I'm just not sure the documentation should "promote" a less "zen" type of usage, which is why I wondered if the omission was intentional. |
Hi, @YSaxon! Thanks so much for your PR! Also thank you @eddyg for posing that question - on seeing this PR, I was wondering the same thing. Since I lack the context about whether this is an intentional omission of the documentation or not, I will surface this internally to my team and then update as soon as I hear back! |
(I just added a couple of commits to fix the functionality itself, after realizing it was hitting a subtle error) |
I would just note that this functionality is clearly already deliberately in the code so it might as well be documented. As to whether it's good or bad:
There also isn't any good way to specify a valid handler if you have some method to register them dynamically and if you forget to add the Whereas if you use the
And then to specify a legal handler is very simple, it's just a |
Thanks for providing the example use case! 👍 This definitely makes it more clear why knowing that this functionality is available would be a useful addition to the docs. |
@YSaxon The pull request alreay looks great to me. Can you check @CLAassistant's mesage above? It seems that you're not using the email adress associated with your GitHub user account for the commits. |
Thanks for the precise instructions on how to fix the username issue |
By the way, while I have you devs here, there's another issue that's been bothering me forever which I would love to submit a pull request for, but it's in the closed-source backend code, so maybe you can do it for me. I wrote it up in some detail here Some suggested fixes:
|
@seratch ^ |
@YSaxon Thanks for sharing this! I hear you and actually we've received similar feedback many times in the past. I can escalate you feedback this time, however, I don't anticipate the backend engineering teams can prioritize this kind of enhancements at least in the short term, due to priorities and other circumstances. So sorry for the inconvenience. |
Ok, but please do pass to them my third suggestion in particular, putting the blocks field into the command payload, as I very strongly suspect that this can be done in seven characters on a single line of code somewhere (adding |
* Fix perform_bot_token_rotation call in AsyncInstallationStoreAuthorize (slackapi#825) * Fix perform_bot_token_rotation call of AsyncTokenRotator * Fix pytype inconsistency in [Async]Listener * version 1.16.2 * Add config.yml for GitHub issues * Rename GH issue type title * Update GH issue type titles * Added redirect url to readme (slackapi#831) * Add documention for injected 'args' param option (slackapi#835) * Fix codecov failure starting in Feb, 2023 (slackapi#836) --------- Co-authored-by: Cristian Caruceru <90720255+ccaruceru@users.noreply.github.com> Co-authored-by: Kazuhiro Sera <seratch@gmail.com> Co-authored-by: Kazuhiro Sera <ksera@slack-corp.com> Co-authored-by: Smyja <akposlive59@gmail.com> Co-authored-by: Yaakov Saxon <YSaxon@users.noreply.github.com>
Hi @YSaxon, we apologize for the inconvenience, but we kindly ask that you sign our new CLA: https://cla.salesforce.com/status/slackapi/bolt-python/pull/893 As it is not fully compatible with the previous agreement you signed for this PR, we need your signature once again. Your cooperation and prompt response would be greatly appreciated. |
(Describe the goal of this PR. Mention any related Issue numbers)
Category
slack_bolt.App
and/or its core componentsslack_bolt.async_app.AsyncApp
and/or its core componentsslack_bolt.adapter
/docs
Requirements
This pull request adds to the docstrings of the Args class the fact that you can use a parameter named 'args' to receive an instance of the Args class (linking to all the other arguments), as an alternative to naming each of the requested arguments one at a time.
This functionality is already implemented in line 97 of the
build_required_kwargs
method in both sync and async but is not presently documented anywhere I could find. The docs themselves just link to this docstring for more info on possible injectable params, and the docstring only mentions injecting its children but not itself.