Fix #1049 by correcting request body format and next_cursor extraction#1061
Merged
seratch merged 1 commit intoslackapi:mainfrom Jul 14, 2021
Merged
Conversation
seratch
commented
Jul 14, 2021
| async def admin_conversations_search(self, **kwargs) -> AsyncSlackResponse: | ||
| """Search for public or private channels in an Enterprise organization.""" | ||
| return await self.api_call("admin.conversations.search", json=kwargs) | ||
| return await self.api_call("admin.conversations.search", params=kwargs) |
Contributor
Author
There was a problem hiding this comment.
As I mentioned in the description, the api_call with the JSON request body is not compatible with the iterator by SlackResponse.
Codecov Report
@@ Coverage Diff @@
## main #1061 +/- ##
=======================================
Coverage 84.33% 84.33%
=======================================
Files 95 95
Lines 8937 8938 +1
=======================================
+ Hits 7537 7538 +1
Misses 1400 1400
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request resolves #1049. While checking this issue, I found that the
__next__iteration does not work if an API method use the JSON request body format. Thus, I've updated all other API methods that support pagination to use www-url-form-encoded request body.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.