Skip to content

Update example code for rate limiting#1076

Merged
seratch merged 2 commits intoslackapi:mainfrom
tjstum:ratedocs
Jul 29, 2021
Merged

Update example code for rate limiting#1076
seratch merged 2 commits intoslackapi:mainfrom
tjstum:ratedocs

Conversation

@tjstum
Copy link
Copy Markdown
Contributor

@tjstum tjstum commented Jul 29, 2021

The API methods themselves are inconsistent about the spelling of
ratelimited vs rate_limited. chat.postMessage spells it
rate_limited. The API docs on rate limiting itself suggest using the
HTTP status code.

This updates the examples in the doc to use the status_code member of
Response objects, instead of looking in the returned JSON.

Closes #1073

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /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

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.
    • n/a: doc change only

The API methods themselves are inconsistent about the spelling of
ratelimited vs rate_limited. chat.postMessage spells it
rate_limited. The API docs on rate limiting itself suggest using the
HTTP status code.

This updates the examples in the doc to use the status_code member of
Response objects, instead of looking in the returned JSON.

Closes slackapi#1073
@gitwave gitwave bot added the untriaged label Jul 29, 2021
@tjstum
Copy link
Copy Markdown
Contributor Author

tjstum commented Jul 29, 2021

I ran the doc generation script, and it proposed a large number of changes (including adding some new files to the repo). Happy to do that if you want, but figured I'd give a shot a the smaller change first.

@seratch
Copy link
Copy Markdown
Contributor

seratch commented Jul 29, 2021

Hi @tjstum, you're so quick! Thanks for fixing the issue 👍

I ran the doc generation script, and it proposed a large number of changes (including adding some new files to the repo). Happy to do that if you want, but figured I'd give a shot a the smaller change first.

Thanks for being careful here. We will run the script when releasing the next version!

Copy link
Copy Markdown
Contributor

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Once the builds pass, we can merge this PR.

@seratch seratch added docs M-T: Documentation work only Version: 3x web-client and removed untriaged labels Jul 29, 2021
@seratch seratch added this to the 3.9.0 milestone Jul 29, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 29, 2021

Codecov Report

Merging #1076 (d07d392) into main (e69eace) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1076      +/-   ##
==========================================
+ Coverage   84.15%   84.19%   +0.03%     
==========================================
  Files          99       99              
  Lines        9255     9255              
==========================================
+ Hits         7789     7792       +3     
+ Misses       1466     1463       -3     
Impacted Files Coverage Δ
slack_sdk/socket_mode/client.py 72.56% <0.00%> (+2.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e69eace...d07d392. Read the comment docs.

@seratch
Copy link
Copy Markdown
Contributor

seratch commented Jul 29, 2021

@tjstum It seems that this is your first contribution. As the CLA assistant bot is taking longer than usual, I'm not sure if you've already signed our CLA but if not, would you mind signing it? Without having it, we are unable to have your contributions for this project. Please access https://cla-assistant.io/slackapi/python-slack-sdk to sign it.

@tjstum
Copy link
Copy Markdown
Contributor Author

tjstum commented Jul 29, 2021

Yup, I signed the CLA shortly before submitting this!

@seratch seratch merged commit 0ca49cf into slackapi:main Jul 29, 2021
seratch added a commit that referenced this pull request Jul 30, 2021
@tjstum tjstum deleted the ratedocs branch August 5, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs M-T: Documentation work only Version: 3x web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spelling of HTTP 429 error is inconsistent

2 participants