Skip to content

Commit e622f2a

Browse files
authored
Merge pull request #1037 from plotly/cached-no-update
fix #1014 - test for no_update by type rather than identity
2 parents 19fe714 + 99b4cf5 commit e622f2a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77
### Changed
88
- [#1035](https://github.com/plotly/dash/pull/1035) Simplify our build process.
99

10+
### Fixed
11+
- [#1037](https://github.com/plotly/dash/pull/1037) Fix no_update test to allow copies, such as those stored and retrieved from a cache.
12+
1013
## [1.7.0] - 2019-11-27
1114
### Added
1215
- [#967](https://github.com/plotly/dash/pull/967) Add support for defining

dash/dash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ def add_context(*args, **kwargs):
13571357
has_update = False
13581358
for i, o in enumerate(output):
13591359
val = output_value[i]
1360-
if val is not no_update:
1360+
if not isinstance(val, _NoUpdate):
13611361
has_update = True
13621362
o_id, o_prop = o.component_id, o.component_property
13631363
component_ids[o_id][o_prop] = val
@@ -1367,7 +1367,7 @@ def add_context(*args, **kwargs):
13671367

13681368
response = {"response": component_ids, "multi": True}
13691369
else:
1370-
if output_value is no_update:
1370+
if isinstance(output_value, _NoUpdate):
13711371
raise exceptions.PreventUpdate
13721372

13731373
response = {

tests/integration/test_integration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import datetime
33
import time
44
import pytest
5+
from copy import copy
56

67
from bs4 import BeautifulSoup
78
from selenium.webdriver.common.keys import Keys
@@ -527,7 +528,8 @@ def show_clicks(n):
527528
return [
528529
no_update if n and n > 4 else n,
529530
no_update if n and n > 2 else n,
530-
no_update,
531+
# make a new instance, to mock up caching and restoring no_update
532+
copy(no_update),
531533
]
532534

533535
dash_duo.start_server(app)

0 commit comments

Comments
 (0)