Having a default of None will allow for consistency within the ViewStateValue object. All other attributes default to None, but selected_options does not get set if the input is an empty list (ex Checkbox). This results in an AttributeError.
Reproducible in:
The Slack SDK version
slack-bolt==1.4.4
Python runtime version
Python 3.8.3
OS info
OS info
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H524
Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
- Instantiate a
ViewStateValue with selected_options as an empty list
- See below
Expected result:
selected_options should default to None
Actual result:
>>> d = {"selected_options": []}
>>> v = ViewStateValue(**d)
>>> v
<slack_sdk.ViewStateValue>
>>> v.selected_channel is None
True
>>> v.selected_options is None
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'ViewStateValue' object has no attribute 'selected_options'
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Having a default of None will allow for consistency within the
ViewStateValueobject. All other attributes default toNone, butselected_optionsdoes not get set if the input is an empty list (ex Checkbox). This results in anAttributeError.Reproducible in:
The Slack SDK version
slack-bolt==1.4.4Python runtime version
Python 3.8.3OS info
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., setup.py))
ViewStateValuewithselected_optionsas an empty listExpected result:
selected_optionsshould default to NoneActual result:
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.