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

improve error message for components #1045

Closed
wants to merge 10 commits into from
Closed

Conversation

chriddyp
Copy link
Member

@chriddyp chriddyp commented Dec 10, 2019

These error messages are hard to parse in large projects especially after upgrading. For example, I'm working on a project right now that has the following error message:

  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash_docs/tutorial/__init__.py", line 11, in <module>
    from .import daq_component_examples as daq_examples
  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash_docs/tutorial/daq_component_examples.py", line 969, in <module>
    ''', style=styles.code_container),
  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash_docs/tutorial/utils/component_block.py", line 27, in ComponentBlock
    raise e
  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash_docs/tutorial/utils/component_block.py", line 19, in ComponentBlock
    exec(converted_string, scope)
  File "<string>", line 6, in <module>
  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash/development/base_component.py", line 324, in wrapper
    return func(*args, **kwargs)
  File "<string>", line 66, in __init__
  File "/Users/chriddyp/Repos/dash-stuff/dash-enterprise-docs/vv/lib/python3.6/site-packages/dash/development/base_component.py", line 94, in __init__
    ", ".join(sorted(self._prop_names))
TypeError: Unexpected keyword argument `height`
Allowed arguments: base, className, color, id, label, labelPosition, logarithmic, max, min, scale, showCurrentValue, size, style, units, value

I'm not even sure which component library let alone component is failing!

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follow
    • this github #PR number updates the dash docs
    • here is the show and tell thread in plotly dash community

since most of these issues happen when upgrading components
`__version__` should always be defined if the component was made from the boilerplate, but a 3rd party component could presumably remove it.
@chriddyp
Copy link
Member Author

chriddyp commented Jan 7, 2020

Alright, I added 3 tests and a changelog entry. This is ready for review!

otherwise, `id` might not have been assigned to `self` at this point in
the loop
@chriddyp
Copy link
Member Author

chriddyp commented Jan 8, 2020

Closing in favor of #1074 which is off the top of dev.

@chriddyp chriddyp closed this Jan 8, 2020
@chriddyp chriddyp deleted the chriddyp-patch-1 branch January 8, 2020 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant