@@ -578,6 +578,28 @@ def infer_config(args, constructor, trace_patch):
578
578
+ ["error_y" , "error_y_minus" , "error_z" , "error_z_minus" ]
579
579
+ ["lat" , "lon" , "locations" , "animation_group" ]
580
580
)
581
+ array_attrables = ["dimensions" , "hover_data" ]
582
+ group_attrables = ["animation_frame" , "facet_row" , "facet_col" , "line_group" ]
583
+
584
+ df_columns = args ["data_frame" ].columns
585
+
586
+ for attr in attrables + group_attrables + ["color" ]:
587
+ if attr in args and args [attr ] is not None :
588
+ maybe_col_list = [args [attr ]] if attr not in array_attrables else args [attr ]
589
+ for maybe_col in maybe_col_list :
590
+ try :
591
+ in_cols = maybe_col in df_columns
592
+ except TypeError :
593
+ in_cols = False
594
+ if not in_cols :
595
+ value_str = (
596
+ "Element of value" if attr in array_attrables else "Value"
597
+ )
598
+ raise ValueError (
599
+ "%s of '%s' is not the name of a column in 'data_frame'. "
600
+ "Expected one of %s but received: %s"
601
+ % (value_str , attr , str (list (df_columns )), str (maybe_col ))
602
+ )
581
603
582
604
attrs = [k for k in attrables if k in args ]
583
605
grouped_attrs = []
@@ -645,7 +667,7 @@ def infer_config(args, constructor, trace_patch):
645
667
args [position ] = args ["marginal" ]
646
668
args [other_position ] = None
647
669
648
- for k in [ "animation_frame" , "facet_row" , "facet_col" , "line_group" ] :
670
+ for k in group_attrables :
649
671
if k in args :
650
672
grouped_attrs .append (k )
651
673
0 commit comments