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):
292292 return isinstance (v , dict ) and "bdata" in v and "dtype" in v
293293
294294
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+
295304def is_none_or_typed_array_spec (v ):
296305 return v is None or is_typed_array_spec (v )
297306
@@ -491,7 +500,7 @@ def description(self):
491500 def validate_coerce (self , v ):
492501 if is_none_or_typed_array_spec (v ):
493502 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 ) :
495504 v = to_scalar_or_list (v )
496505 elif is_homogeneous_array (v ):
497506 v = to_typed_array_spec (v )
You can’t perform that action at this time.
0 commit comments