Skip to content

Allow boolean kwargs #560

@roman-kachanovsky

Description

@roman-kachanovsky

Description

It's a bit confusing that endpoint methods require boolean values represented as strings like "true" or "false" and throw TypeError exception in case of using native boolean type.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

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

  • 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 searched for any related issues and avoided creating a duplicate issue.

Reproducible in:

slackclient version: 2.3.1
python version: 3.7.1

Steps to reproduce:

from slack import WebClient
client = WebClient(token)
client.conversations_list(exclude_archived="true")  # ok
client.conversations_list(exclude_archived=True)  # TypeError

Expected result:

SlackResponse instance

Actual result:

~/venv/bbot/lib/python3.7/site-packages/yarl/__init__.py in _query_var(v)
    825             "Invalid variable type: value "
    826             "should be str or int, got {!r} "
--> 827             "of type {}".format(v, type(v))
    828         )
    829 

TypeError: Invalid variable type: value should be str or int, got True of type <class 'bool'>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions