-
-
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
Type annotations in dash
(+ add mypy
tests in CI)
#1748
Closed
Closed
Changes from all commits
Commits
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
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 |
---|---|---|
|
@@ -35,17 +35,17 @@ def __nonzero__(self): | |
|
||
# pylint: disable=no-init | ||
class CallbackContext: | ||
@property | ||
@property # type: ignore[misc] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably due to python/mypy#1362. |
||
@has_context | ||
def inputs(self): | ||
return getattr(flask.g, "input_values", {}) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def states(self): | ||
return getattr(flask.g, "state_values", {}) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def triggered(self): | ||
# For backward compatibility: previously `triggered` always had a | ||
|
@@ -54,17 +54,17 @@ def triggered(self): | |
# look empty, but you can still do `triggered[0]["prop_id"].split(".")` | ||
return getattr(flask.g, "triggered_inputs", []) or falsy_triggered | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def args_grouping(self): | ||
return getattr(flask.g, "args_grouping", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def outputs_grouping(self): | ||
return getattr(flask.g, "outputs_grouping", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def outputs_list(self): | ||
if self.using_outputs_grouping: | ||
|
@@ -75,7 +75,7 @@ def outputs_list(self): | |
|
||
return getattr(flask.g, "outputs_list", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def inputs_list(self): | ||
if self.using_args_grouping: | ||
|
@@ -86,7 +86,7 @@ def inputs_list(self): | |
|
||
return getattr(flask.g, "inputs_list", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def states_list(self): | ||
if self.using_args_grouping: | ||
|
@@ -96,7 +96,7 @@ def states_list(self): | |
) | ||
return getattr(flask.g, "states_list", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def response(self): | ||
return getattr(flask.g, "dash_response") | ||
|
@@ -125,7 +125,7 @@ def record_timing(name, duration=None, description=None): | |
|
||
setattr(flask.g, "timing_information", timing_information) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def using_args_grouping(self): | ||
""" | ||
|
@@ -134,7 +134,7 @@ def using_args_grouping(self): | |
""" | ||
return getattr(flask.g, "using_args_grouping", []) | ||
|
||
@property | ||
@property # type: ignore[misc] | ||
@has_context | ||
def using_outputs_grouping(self): | ||
""" | ||
|
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
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
Oops, something went wrong.
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.
If taken further, I'll try replace
dict
withDict
with more information about the underlying structure.