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

fix #1014 - test for no_update by type rather than identity #1037

Merged
merged 4 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- [#1035](https://github.com/plotly/dash/pull/1035) Simplify our build process.

### Fixed
- [#1037](https://github.com/plotly/dash/pull/1037) Fix no_update test to allow copies, such as those stored and retrieved from a cache.

## [1.7.0] - 2019-11-27
### Added
- [#967](https://github.com/plotly/dash/pull/967) Add support for defining
Expand Down
4 changes: 2 additions & 2 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ def add_context(*args, **kwargs):
has_update = False
for i, o in enumerate(output):
val = output_value[i]
if val is not no_update:
if not isinstance(val, _NoUpdate):
has_update = True
o_id, o_prop = o.component_id, o.component_property
component_ids[o_id][o_prop] = val
Expand All @@ -1367,7 +1367,7 @@ def add_context(*args, **kwargs):

response = {"response": component_ids, "multi": True}
else:
if output_value is no_update:
if isinstance(output_value, _NoUpdate):
raise exceptions.PreventUpdate

response = {
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import time
import pytest
from copy import copy

from bs4 import BeautifulSoup
from selenium.webdriver.common.keys import Keys
Expand Down Expand Up @@ -527,7 +528,8 @@ def show_clicks(n):
return [
no_update if n and n > 4 else n,
no_update if n and n > 2 else n,
no_update,
# make a new instance, to mock up caching and restoring no_update
copy(no_update),
]

dash_duo.start_server(app)
Expand Down