Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePickerElement - missing placeholder causes TypeError #623

Closed
4 of 9 tasks
jeremyschulman opened this issue Feb 18, 2020 · 3 comments
Closed
4 of 9 tasks

DatePickerElement - missing placeholder causes TypeError #623

jeremyschulman opened this issue Feb 18, 2020 · 3 comments
Assignees
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x web-client
Milestone

Comments

@jeremyschulman
Copy link

jeremyschulman commented Feb 18, 2020

Description

When using a DatePickerElement object, if the placeholder attribute is not provided and to_dict() is called a TypeError is raised.

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.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: 2.5.0

python version: 3.6.8

OS version(s): MacOS Mojave

Steps to reproduce:

from slack.web.classes.elements import DatePickerElement
ele = DatePickerElement(action_id='1')
ele.to_dict()

Result in Exception:

~/venv/lib/python3.6/site-packages/slackclient-2.5.0-py3.6.egg/slack/web/classes/elements.py in placeholder_length(self)
    187     )
    188     def placeholder_length(self):
--> 189         return len(self.placeholder) <= self.placeholder_max_length
    190
    191     def to_dict(self,) -> dict:

TypeError: object of type 'NoneType' has no len()

Expected result:

No exception as the placeholder attribute is optional.

Actual result:

TypeError exception raised.

@stevengill stevengill added the bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented label Feb 18, 2020
@seratch seratch self-assigned this Mar 17, 2020
@seratch seratch added this to the 2.6.0 milestone Apr 20, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue Apr 28, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue Apr 28, 2020
@seratch
Copy link
Member

seratch commented Apr 28, 2020

PR #659 fixes this issue. The change will be included in version 2.6.0 (that's going to be released in a few weeks)

seratch added a commit to seratch/python-slack-sdk that referenced this issue Apr 28, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 11, 2020
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 11, 2020
* Fix slackapi#639 Missing blocks & block elements
  * blocks
    * file blocks (for remote files)
    * rich-text blocks (out-of-scope in this commit)
  * block elements
    * multi-select elements
    * checkboxes
    * radio buttons
    * input block's elements slackapi#519
    * rich text elements (out-of-scope in this commit)
    * filtering options for conversations
* Fix slackapi#519 as mentioned above
* Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError

* Add view support for modals and Home tabs ref slackapi#519
* Move parser methods to class methods, add more tests for view.state
* Rename validation methods and fix backward incompatibilities
* Add a test case for slackapi#623 and revise subtype getter
* Fix slackapi#628 text length validation in SectionBlock
* Add a sample using native Block Kit builders ref slackapi#500
seratch added a commit to seratch/python-slack-sdk that referenced this issue May 11, 2020
* Fix slackapi#639 Missing blocks & block elements
  * blocks
    * file blocks (for remote files)
    * rich-text blocks (out-of-scope in this commit)
  * block elements
    * multi-select elements
    * checkboxes
    * radio buttons
    * input block's elements slackapi#519
    * rich text elements (out-of-scope in this commit)
    * filtering options for conversations
* Fix slackapi#519 as mentioned above
* Fix slackapi#632 DatePickerElement - missing placeholder causes TypeError

* Add view support for modals and Home tabs ref slackapi#519
* Move parser methods to class methods, add more tests for view.state
* Rename validation methods and fix backward incompatibilities
* Add a test case for slackapi#623 and revise subtype getter
* Fix slackapi#628 text length validation in SectionBlock
* Add a sample using native Block Kit builders ref slackapi#500
@seratch
Copy link
Member

seratch commented May 14, 2020

Fixed by #659

@seratch seratch closed this as completed May 14, 2020
@seratch
Copy link
Member

seratch commented May 15, 2020

👋 slackclient 2.6.0rc1 is out. The pre-release version contains fixes for your issue described here.
https://pypi.org/project/slackclient/2.6.0rc1/

One week later from now, we'll be releasing version 2.6.0 to PyPI.

If you have a chance, could you try the release candidate version out and let us know your feedback? Thank you very much for being patient with this issue.

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: 2x web-client
Projects
None yet
Development

No branches or pull requests

3 participants