Skip to content

Commit 277f1bb

Browse files
committed
revisit validator
1 parent bfa17b0 commit 277f1bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/python/plotly/_plotly_utils/basevalidators.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ def is_homogeneous_array(v):
207207
return False
208208

209209

210+
def is_typed_array_spec(v):
211+
"""
212+
Return whether a value is considered to be a typed array spec for plotly.js
213+
"""
214+
return isinstance(v, dict) and "bdata" in v
215+
216+
210217
def is_simple_array(v):
211218
"""
212219
Return whether a value is considered to be an simple array
@@ -404,6 +411,9 @@ def validate_coerce(self, v):
404411
if v is None:
405412
# Pass None through
406413
pass
414+
elif is_typed_array_spec(v):
415+
# Pass typed array spec through
416+
pass
407417
elif is_homogeneous_array(v):
408418
v = copy_to_readonly_numpy_array(v)
409419
elif is_simple_array(v):

0 commit comments

Comments
 (0)