Skip to content

Fix #1200 Model to_dict doesn't handle tuple sequences#1206

Merged
seratch merged 2 commits intoslackapi:mainfrom
seratch:issue-1200
May 3, 2022
Merged

Fix #1200 Model to_dict doesn't handle tuple sequences#1206
seratch merged 2 commits intoslackapi:mainfrom
seratch:issue-1200

Conversation

@seratch
Copy link
Copy Markdown
Contributor

@seratch seratch commented May 3, 2022

Summary

This pull request resolves #1200

Category (place an x in each of the [ ])

  • 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 ./scripts/docs.sh?)
  • /docs-src-v2 (Documents, have you run ./scripts/docs-v2.sh?)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements (place an x in each [ ])

  • 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.

@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented web-client Version: 3x labels May 3, 2022
@seratch seratch added this to the 3.15.3 milestone May 3, 2022
@seratch seratch self-assigned this May 3, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented May 3, 2022

Codecov Report

Merging #1206 (56850a5) into main (9fb0df9) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1206      +/-   ##
==========================================
- Coverage   86.51%   86.50%   -0.01%     
==========================================
  Files         110      110              
  Lines       10872    10872              
==========================================
- Hits         9406     9405       -1     
- Misses       1466     1467       +1     
Impacted Files Coverage Δ
slack_sdk/models/basic_objects.py 91.52% <100.00%> (ø)
slack_sdk/socket_mode/builtin/internals.py 70.61% <0.00%> (-0.44%) ⬇️

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 9fb0df9...56850a5. Read the comment docs.

@seratch seratch requested a review from filmaj May 3, 2022 05:48
Copy link
Copy Markdown
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

Looks great! Left some very minor suggestions on labeling. I also can't think of why the code coverage dropped... 🤔

value: Union[dict, list, object, Tuple]
) -> Union[dict, list, Any]:
if isinstance(value, list): # skipcq: PYL-R1705
if isinstance(value, (list, Tuple)): # skipcq: PYL-R1705
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I love that this line of code also uses a tuple 😆

Co-authored-by: Fil Maj <maj.fil@gmail.com>
@seratch seratch merged commit a347a98 into slackapi:main May 3, 2022
@seratch seratch deleted the issue-1200 branch May 3, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 3x web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model to_dict doesn't handle tuple sequences

2 participants