@@ -145,17 +145,7 @@ def test_dataframe_groupby_transform_conflicting_labels_negative():
145
145
pd .show (df )
146
146
147
147
148
- @sql_count_checker (
149
- query_count = 7 ,
150
- # Pivot step performs force materialization of the dataframe. So joins in subquery
151
- # are not carried over but after removing the pivot step subquery is present
152
- # multiple times resulting to increase in join count.
153
- join_count = 12 ,
154
- udtf_count = 1 ,
155
- high_count_expected = True ,
156
- high_count_reason = "performing two groupby transform operations that use UDTFs and compare with pandas" ,
157
- )
158
- def test_dataframe_groupby_transform_conflicting_labels ():
148
+ def test_dataframe_groupby_transform_conflicting_labels (session ):
159
149
"""
160
150
Based on SNOW-1361200 - The bug occurred because of conflicting UDTF columns appended during groupby transform
161
151
operations in `create_udtf_for_groupby_apply`.
@@ -167,11 +157,19 @@ def transform_helper(df):
167
157
df ["A" ] = df .groupby ("X" )["X_DATA" ].transform ("count" )
168
158
df ["B" ] = df .groupby ("X" )["X_DATA" ].transform ("count" )
169
159
170
- eval_snowpark_pandas_result (
171
- * create_test_dfs ({"X" : [1 , 2 , 3 , 1 , 2 , 2 ], "Y" : [4 , 5 , 6 , 7 , 8 , 9 ]}),
172
- transform_helper ,
173
- inplace = True ,
174
- )
160
+ with SqlCounter (
161
+ query_count = 7 ,
162
+ join_count = 12 if session .sql_simplifier_enabled else 6 ,
163
+ udtf_count = 1 ,
164
+ high_count_expected = True ,
165
+ high_count_reason = "performing two groupby transform operations that use UDTFs and compare "
166
+ "with pandas" ,
167
+ ):
168
+ eval_snowpark_pandas_result (
169
+ * create_test_dfs ({"X" : [1 , 2 , 3 , 1 , 2 , 2 ], "Y" : [4 , 5 , 6 , 7 , 8 , 9 ]}),
170
+ transform_helper ,
171
+ inplace = True ,
172
+ )
175
173
176
174
177
175
@sql_count_checker (
0 commit comments