-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Provide support for no_update in Dash for R #111
Conversation
Looks great! Now that we have a test framework, let's get in the habit of testing new features as they come in here. You should be able to essentially just port this one test, but simplify it - take out the https://github.com/plotly/dash/blob/master/tests/integration/test_integration.py#L120-L178 |
@alexcjohnson I identified a minor issue today while reviewing app PRs with the new code, the following warning appears periodically for some applications:
I'll resolve this and comment in this PR when the commit is made, in addition to adding in the test we discussed. |
fixed in d1f384f |
@rpkyle I would like a change in the test with the new proposed API in plotly/dash#859 |
The current test failure - where the value hasn't updated between the In this case the |
this represents a common scenario where you would like to check something after an action and would like to wait a little bit so the assertion was not made too early to test nothing. instead of the sleep then assert (our current way), I'm proposing to have sth similar to
|
@byronz not sure I quite follow you re: |
@alexcjohnson I'm not talking about change this right now in this PR, but something we might need as test API like |
fixed in ae7b1b0 |
fixed in 8f6dafd |
dashr.find_element("#color-selector").click() | ||
dashr.find_elements("div.VirtualizedSelectOption")[0].click() | ||
time.sleep(1) | ||
assert dashr.find_element("#message-box").text == "The hexadecimal representation of your last chosen color is #FF0000" |
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.
Not to beat a dead horse, but since this is one of the first tests I'd like to make sure we get the best pattern for all the other tests to build on.
time.sleep
should be a last resort. In this test you only need it when the text is expected to be the same after the action as it was before - ie just the checks after ...[3].click()
. But in all the other cases you can do
dashr.wait_for_text_to_equal(
"#message-box",
"The hexadecimal representation of your last chosen color is #FF0000"
)
Which will return as soon as the correct value is found on the page, saving us most of that 1 sec delay each time.
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.
fixed in be9d387
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.
💃 Alright, one more feature toward parity!
* rename pruned_errors to prune_errors * rename pruned to prune * provide support for no_update in Dash for R (#111)
* Provide support for no_update in Dash for R (#111) * Use dev_tools_prune_errors instead of pruned_errors (#113) * Better handling for user-defined error conditions in debug mode (#116) * Provide support for multiple outputs (#119) * Provide support for hot reloading in Dash for R (#127) * Implement support for clientside callbacks in Dash for R (#130) * Add line number context to stack traces when srcrefs are available (#133) * Update dash-renderer to 1.2.2 and fix dev tools UI display of stack traces (#137) * Support for meta tags in Dash for R (#142) * Fixes for hot reloading interval handling and refreshing apps within viewer pane (#148) * Support for asynchronous loading/compression in Dash for R (#157) * Support returning asset URLs via public method within Dash class (#160) * Minor fix for get_asset_url + docs, add url_base_pathname (#161)
This PR proposes to introduce a function entitled
dashNoUpdate()
which functions analogously todash.no_update
in Python, although the implementation differs slightly.As with its counterpart, the function permits developers to selectively prevent one or more outputs from updating the layout. Currently,
dashNoUpdate()
only supports single-output callbacks, but should be easily extended to the multiple outputs scenario when that feature is available in R.Additionally, the
response$body
returned is an empty character string, with aresponse$status
of204
:dashR/R/dash.R
Lines 294 to 299 in b23c248
Closes #25.
@Marc-Andre-Rivet