Add explicit arguments for files_info#1085
Add explicit arguments for files_info#1085seratch merged 6 commits intoslackapi:mainfrom jaebradley:remove-unnecessary-kwargs-for-some-files-methods
Conversation
| return self.api_call("files.delete", json={"file": file}) | ||
|
|
||
| def files_info(self, *, file: str, **kwargs) -> SlackResponse: | ||
| def files_info( |
| return self.api_call("files.comments.delete", json=kwargs) | ||
| return self.api_call("files.comments.delete", json={"file": file, "id": id}) | ||
|
|
||
| def files_delete(self, *, file: str, **kwargs) -> SlackResponse: |
There was a problem hiding this comment.
The kwargs is still needed even if we have all the possible arguments. **kwargs can work as a workaround when developers try beta features and/or the SDK does not support newly added arguments until new version releases. This request is the same for other changes.
|
@jaebradley Thanks for taking the time to make this pull request! Can you check my comments above? Thanks! |
Co-authored-by: Kazuhiro Sera <seratch@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #1085 +/- ##
=======================================
Coverage 85.62% 85.62%
=======================================
Files 99 99
Lines 9324 9324
=======================================
Hits 7984 7984
Misses 1340 1340
Continue to review full report at Codecov.
|
seratch
left a comment
There was a problem hiding this comment.
Looks good to me. Once the CI builds pass, I'll merge this PR!
|
@jaebradley Congrats on your first contribution to this project 🎉 and thanks again for taking the time to work on it! |
|
@seratch thanks for the review! |

Summary
Tangentially related to #1018 , the main purpose was to potentially clean up the public interface for some
files_*methods as well as expand and clarify my understanding of those API methods.Based on the public API documentation available (like the API documentation page for the
files_infomethod) I attempted to clean up the arguments for thefiles_comments_delete,files_delete, andfiles_infomethods.This is technically a breaking change. To keep this non-breaking, I could keep the
kwargsin addition to defining the explicit method arguments.Category (place an
xin each of the[ ])/docs-src(Documents, have you run./docs.sh?)/docs-src-v2(Documents, have you run./docs-v2.sh?)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements (place an
xin each[ ])python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.