@@ -1958,7 +1958,8 @@ def the_sum(s1, s2, x):
19581958
19591959 # Fails to apply on dataframe with incompatible number of columns.
19601960 with pytest .raises (
1961- ValueError , match = "^Parameter count mismatch:.* expected 3 but received 4."
1961+ ValueError ,
1962+ match = "^Parameter count mismatch:.* expected 3 parameters but received 4 values.*" ,
19621963 ):
19631964 scalars_df [columns ].apply (
19641965 the_sum_mf ,
@@ -2306,11 +2307,13 @@ def foo(x, y, z):
23062307
23072308 # Fails to apply on dataframe with incompatible number of columns
23082309 with pytest .raises (
2309- ValueError , match = "^Parameter count mismatch:.* expected 3 but received 2."
2310+ ValueError ,
2311+ match = "^Parameter count mismatch:.* expected 3 parameters but received 2 DataFrame.*" ,
23102312 ):
23112313 bf_df [["Id" , "Age" ]].apply (foo , axis = 1 )
23122314 with pytest .raises (
2313- ValueError , match = "^Parameter count mismatch:.* expected 3 but received 4."
2315+ ValueError ,
2316+ match = "^Parameter count mismatch:.* expected 3 parameters but received 4 DataFrame.*" ,
23142317 ):
23152318 bf_df .assign (Country = "lalaland" ).apply (foo , axis = 1 )
23162319
@@ -2388,11 +2391,13 @@ def foo(x, y, z):
23882391
23892392 # Fails to apply on dataframe with incompatible number of columns
23902393 with pytest .raises (
2391- ValueError , match = "^Parameter count mismatch:.* expected 3 but received 2."
2394+ ValueError ,
2395+ match = "^Parameter count mismatch:.* expected 3 parameters but received 2 DataFrame.*" ,
23922396 ):
23932397 bf_df [["Id" , "Age" ]].apply (foo , axis = 1 )
23942398 with pytest .raises (
2395- ValueError , match = "^Parameter count mismatch:.* expected 3 but received 4."
2399+ ValueError ,
2400+ match = "^Parameter count mismatch:.* expected 3 parameters but received 4 DataFrame.*" ,
23962401 ):
23972402 bf_df .assign (Country = "lalaland" ).apply (foo , axis = 1 )
23982403
@@ -2460,11 +2465,13 @@ def foo(x):
24602465
24612466 # Fails to apply on dataframe with incompatible number of columns
24622467 with pytest .raises (
2463- ValueError , match = "^Parameter count mismatch:.* expected 1 but received 0."
2468+ ValueError ,
2469+ match = "^Parameter count mismatch:.* expected 1 parameters but received 0 DataFrame.*" ,
24642470 ):
24652471 bf_df [[]].apply (foo , axis = 1 )
24662472 with pytest .raises (
2467- ValueError , match = "^Parameter count mismatch:.* expected 1 but received 2."
2473+ ValueError ,
2474+ match = "^Parameter count mismatch:.* expected 1 parameters but received 2 DataFrame.*" ,
24682475 ):
24692476 bf_df .assign (Country = "lalaland" ).apply (foo , axis = 1 )
24702477
0 commit comments