-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Raise exception when same input & output are used in a callback #605
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b2ede32
:rotating_light: Only close process if the server actually started.
T4rk1n eb46641
:white_check_mark: Add same input/output callback check test.
T4rk1n 209605e
:hammer: Improve dependencies classes.
T4rk1n 673b8db
:bug: Raise SameInputOutputException when validating callbacks.
T4rk1n 5ce19b8
:rotating_light: Assert same input output exception message.
T4rk1n c5d114f
:shirt: Fix E128
T4rk1n 2b743ef
:shirt: Fix E302, old-style-class
T4rk1n d72e4aa
:pencil: Update changelog
T4rk1n 128fe8c
:hammer: Assert instance of DashDependency equality.
T4rk1n f2afd05
Merge branch 'master' into fix-wrong-callback
T4rk1n 356ff07
:shirt: Remove old-style-class disable
T4rk1n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
# pylint: disable=old-style-class, too-few-public-methods | ||
class Output: | ||
class DashDependency: | ||
def __init__(self, component_id, component_property): | ||
self.component_id = component_id | ||
self.component_property = component_property | ||
|
||
def __str__(self): | ||
return '{}.{}'.format( | ||
self.component_id, | ||
self.component_property | ||
) | ||
|
||
def __repr__(self): | ||
return '<{} `{}`>'.format(self.__class__.__name__, self) | ||
|
||
def __eq__(self, other): | ||
return str(self) == str(other) | ||
alexcjohnson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def __hash__(self): | ||
return hash(str(self)) | ||
|
||
# pylint: disable=old-style-class, too-few-public-methods | ||
class Input: | ||
def __init__(self, component_id, component_property): | ||
self.component_id = component_id | ||
self.component_property = component_property | ||
class Output(DashDependency): | ||
"""Output of a callback.""" | ||
|
||
|
||
# pylint: disable=old-style-class, too-few-public-methods | ||
class State: | ||
def __init__(self, component_id, component_property): | ||
self.component_id = component_id | ||
self.component_property = component_property | ||
class Input(DashDependency): | ||
"""Input of callback trigger an update when it is updated.""" | ||
|
||
|
||
# pylint: disable=old-style-class, too-few-public-methods | ||
class State(DashDependency): | ||
"""Use the value of a state in a callback but don't trigger updates.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to need some changes for multi-output...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'll update once merged.