@@ -152,6 +152,7 @@ def test_df_loc_get_tuple_key(
152152
153153 with SqlCounter (
154154 query_count = query_count ,
155+ join_count = 2 ,
155156 ):
156157 eval_snowpark_pandas_result (
157158 str_index_snowpark_pandas_df ,
@@ -314,15 +315,15 @@ def test_df_loc_get_empty_key(
314315 default_index_native_df ,
315316):
316317
317- with SqlCounter (query_count = 1 ):
318+ with SqlCounter (query_count = 1 , join_count = 1 ):
318319 eval_snowpark_pandas_result (
319320 empty_snowpark_pandas_df ,
320321 native_pd .DataFrame (),
321322 lambda df : df .loc [key ],
322323 comparator = assert_snowpark_pandas_equal_to_pandas ,
323324 check_column_type = False ,
324325 )
325- with SqlCounter (query_count = 1 ):
326+ with SqlCounter (query_count = 1 , join_count = 1 ):
326327 eval_snowpark_pandas_result (
327328 default_index_snowpark_pandas_df ,
328329 default_index_native_df ,
@@ -1913,6 +1914,7 @@ def _test_df_loc_with_1k_shape(
19131914 with SqlCounter (
19141915 query_count = query_count ,
19151916 join_count = 1 ,
1917+ union_count = 1 ,
19161918 high_count_expected = high_count_expected ,
19171919 high_count_reason = high_count_reason ,
19181920 ):
@@ -2575,7 +2577,7 @@ def test_empty_df_loc_set_scalar():
25752577 with pytest .raises (ValueError , match = "cannot set a frame with no defined columns" ):
25762578 native_df .loc [0 ] = 1
25772579
2578- with SqlCounter (query_count = 1 ):
2580+ with SqlCounter (query_count = 1 , join_count = 1 ):
25792581 snow_df .loc [0 ] = 1
25802582 assert_snowpark_pandas_equal_to_pandas (
25812583 snow_df ,
@@ -2603,23 +2605,23 @@ def col_loc(df):
26032605 native_df = native_pd .DataFrame (index = [0 , 1 , 2 ])
26042606 snow_df = pd .DataFrame (native_df )
26052607 # Check `loc` with row scalar on empty DataFrame with non-empty index.
2606- with SqlCounter (query_count = 1 ):
2608+ with SqlCounter (query_count = 1 , join_count = 1 ):
26072609 eval_snowpark_pandas_result (
26082610 snow_df , native_df , row_loc , inplace = True , check_column_type = False
26092611 )
26102612
26112613 native_df = native_pd .DataFrame (index = [0 , 1 , 2 ])
26122614 snow_df = pd .DataFrame (native_df )
26132615 # Check `loc` with column scalar on empty DataFrame with non-empty index.
2614- with SqlCounter (query_count = 1 ):
2616+ with SqlCounter (query_count = 1 , join_count = 1 ):
26152617 eval_snowpark_pandas_result (
26162618 snow_df , native_df , col_loc , inplace = True , check_column_type = False
26172619 )
26182620
26192621 native_df = native_pd .DataFrame (columns = ["A" , "B" , "C" ])
26202622 snow_df = pd .DataFrame (native_df )
26212623 # Check `loc` with row scalar on empty DataFrame with non-empty columns.
2622- with SqlCounter (query_count = 1 ):
2624+ with SqlCounter (query_count = 1 , join_count = 1 ):
26232625 eval_snowpark_pandas_result (
26242626 snow_df ,
26252627 native_df ,
@@ -2630,7 +2632,7 @@ def col_loc(df):
26302632 native_df = native_pd .DataFrame (columns = ["A" , "B" , "C" ])
26312633 snow_df = pd .DataFrame (native_df )
26322634 # Check `loc` with column scalar on empty DataFrame with non-empty columns.
2633- with SqlCounter (query_count = 1 ):
2635+ with SqlCounter (query_count = 1 , join_count = 1 ):
26342636 col_loc (snow_df )
26352637 assert_snowpark_pandas_equal_to_pandas (
26362638 snow_df ,
@@ -2642,7 +2644,7 @@ def col_loc(df):
26422644 native_df = native_pd .DataFrame (index = [0 , 1 , 2 ], columns = ["A" , "B" , "C" ])
26432645 snow_df = pd .DataFrame (native_df )
26442646 # Check `loc` with row scalar on empty DataFrame with non-empty index and columns.
2645- with SqlCounter (query_count = 1 ):
2647+ with SqlCounter (query_count = 1 , join_count = 1 ):
26462648 eval_snowpark_pandas_result (
26472649 snow_df ,
26482650 native_df ,
@@ -2653,7 +2655,7 @@ def col_loc(df):
26532655 native_df = native_pd .DataFrame (index = [0 , 1 , 2 ], columns = ["A" , "B" , "C" ])
26542656 snow_df = pd .DataFrame (native_df )
26552657 # Check `loc` with column scalar on empty DataFrame with non-empty index and columns.
2656- with SqlCounter (query_count = 1 ):
2658+ with SqlCounter (query_count = 1 , join_count = 1 ):
26572659 eval_snowpark_pandas_result (
26582660 snow_df ,
26592661 native_df ,
@@ -3959,7 +3961,12 @@ def test_df_loc_get_with_timedelta(key, query_count, join_count):
39593961 idx = ["1 days" , "2 days" , "3 days" ]
39603962 native_df = native_pd .DataFrame (data , index = native_pd .to_timedelta (idx ))
39613963 snow_df = pd .DataFrame (data , index = pd .to_timedelta (idx ))
3962- with SqlCounter (query_count = query_count , join_count = join_count ):
3964+ union_count = (
3965+ 1 if isinstance (key , (list , slice )) and not isinstance (key , str ) else 0
3966+ )
3967+ with SqlCounter (
3968+ query_count = query_count , join_count = join_count , union_count = union_count
3969+ ):
39633970 eval_snowpark_pandas_result (snow_df , native_df , lambda df : df .loc [key ])
39643971
39653972
0 commit comments