@@ -2933,7 +2933,7 @@ def func_for_other(x):
29332933
29342934
29352935@pytest .mark .flaky (retries = 2 , delay = 120 )
2936- def test_remote_function_series_where (session , dataset_id , scalars_dfs ):
2936+ def test_remote_function_series_where_mask (session , dataset_id , scalars_dfs ):
29372937 try :
29382938
29392939 def _ten_times (x ):
@@ -2954,8 +2954,8 @@ def _ten_times(x):
29542954 pd_int64 = scalars_pandas ["float64_col" ]
29552955 pd_int64_filtered = pd_int64 .dropna ()
29562956
2957- # The cond is not a callable and the other is a callable (remote
2958- # function) in series.where method .
2957+ # Test series.where method: the cond is not a callable and the other is
2958+ # a callable (remote function) .
29592959 bf_result = bf_int64_filtered .where (
29602960 cond = bf_int64_filtered < 0 , other = ten_times_mf
29612961 ).to_pandas ()
@@ -2966,6 +2966,16 @@ def _ten_times(x):
29662966 # Ignore any dtype difference.
29672967 pandas .testing .assert_series_equal (bf_result , pd_result , check_dtype = False )
29682968
2969+ # Test series.mask method: the cond is not a callable and the other is
2970+ # a callable (remote function).
2971+ bf_result = bf_int64_filtered .mask (
2972+ cond = bf_int64_filtered < 0 , other = ten_times_mf
2973+ ).to_pandas ()
2974+ pd_result = pd_int64_filtered .mask (cond = pd_int64_filtered < 0 , other = _ten_times )
2975+
2976+ # Ignore any dtype difference.
2977+ pandas .testing .assert_series_equal (bf_result , pd_result , check_dtype = False )
2978+
29692979 finally :
29702980 # Clean up the gcp assets created for the remote function.
29712981 cleanup_function_assets (ten_times_mf , session .bqclient , ignore_failures = False )
0 commit comments