Skip to content

Commit 40166bb

Browse files
committed
Potential fix to conversion bug
1 parent d59ceb0 commit 40166bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/python/plotly/_plotly_utils/basevalidators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import base64
22
import numbers
33
import textwrap
4+
import traceback
45
import uuid
56
from importlib import import_module
67
import copy
@@ -488,9 +489,10 @@ def description(self):
488489
)
489490

490491
def validate_coerce(self, v):
491-
492492
if is_none_or_typed_array_spec(v):
493493
pass
494+
elif 'layer' in self.parent_name or 'range' in self.parent_name or 'geojson' in self.parent_name:
495+
v = to_scalar_or_list(v)
494496
elif is_homogeneous_array(v):
495497
v = to_typed_array_spec(v)
496498
elif is_simple_array(v):

packages/python/plotly/plotly/tests/test_optional/test_graph_objs/test_skipped_b64_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_np_layers(self):
7070

7171
# TODO: This is failing because the actual value of the "dash" field
7272
# is converted to the { b64, dtype } object.
73-
# assert fig.layout['mapbox']['layers'][0]['line']['dash'] == (2.5, 1)
73+
assert fig.layout['mapbox']['layers'][0]['line']['dash'] == (2.5, 1)
7474

7575
assert (
7676
fig.layout["mapbox"]["layers"][0]["source"]["features"][0]["geometry"][

0 commit comments

Comments
 (0)