File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,8 @@ def process_group_robust(
116116 ) -> dict :
117117 group_dict = dict (zip (gb_columns , key ))
118118 predictors = []
119+ if isinstance (weights , str ) and weights not in df_group .columns :
120+ raise ValueError (f"Weight column '{ weights } ' not found in input DataFrame." )
119121
120122 for i , col in enumerate (linear_columns0 ):
121123 required_columns = [col ] + fit_columns + [weights ]
@@ -248,6 +250,9 @@ def make_parallel_fit(
248250 Returns:
249251 Tuple[pd.DataFrame, pd.DataFrame]: DataFrame with predictions and group-level statistics.
250252 """
253+ if isinstance (weights , str ) and weights not in df .columns :
254+ raise ValueError (f"Weight column '{ weights } ' not found in input DataFrame" )
255+
251256 df_selected = df .loc [selection ]
252257 grouped = df_selected .groupby (gb_columns )
253258
You can’t perform that action at this time.
0 commit comments