File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/python/plotly/_plotly_utils Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,15 @@ def is_typed_array_spec(v):
292
292
return isinstance (v , dict ) and "bdata" in v and "dtype" in v
293
293
294
294
295
+ def has_skipped_key (all_parent_keys ):
296
+ """
297
+ Return whether any keys in the parent hierarchy are in the list of keys that
298
+ are skipped for conversion to the typed array spec
299
+ """
300
+ skipped_keys = ['geojson' , 'layer' , 'range' ]
301
+ return any (skipped_key in all_parent_keys for skipped_key in skipped_keys )
302
+
303
+
295
304
def is_none_or_typed_array_spec (v ):
296
305
return v is None or is_typed_array_spec (v )
297
306
@@ -491,7 +500,7 @@ def description(self):
491
500
def validate_coerce (self , v ):
492
501
if is_none_or_typed_array_spec (v ):
493
502
pass
494
- elif 'layer' in self .parent_name or 'range' in self . parent_name or 'geojson' in self . parent_name :
503
+ elif has_skipped_key ( self .parent_name ) :
495
504
v = to_scalar_or_list (v )
496
505
elif is_homogeneous_array (v ):
497
506
v = to_typed_array_spec (v )
You can’t perform that action at this time.
0 commit comments