@@ -311,6 +311,7 @@ def run(ctx):
311311 with pytest .raises (RuntimeError ) as excinfo :
312312 result = executor .run ([Group ([(1 ,), (2 ,), (3 ,), (4 ,), (5 ,), (6 ,)])], exa )
313313
314+
314315def test_get_dataframe_start_col_0 ():
315316 def udf_wrapper ():
316317 def run (ctx ):
@@ -329,23 +330,27 @@ def run(ctx):
329330 result = executor .run ([Group ([(1 ,), (2 ,), (3 ,), (4 ,), (5 ,), (6 ,)])], exa )
330331 assert result == [Group ([(1 ,), ])]
331332
333+
332334def test_get_dataframe_start_col_positive ():
333335 def udf_wrapper ():
334336 def run (ctx ):
335337 df = ctx .get_dataframe (num_rows = 1 , start_col = 1 )
336338 ctx .emit (df )
337339
338- executor = UDFMockExecutor ()
339340 meta = MockMetaData (
340341 script_code_wrapper_function = udf_wrapper ,
341342 input_type = "SET" ,
342- input_columns = [Column ("t" , int , "INTEGER" )],
343+ input_columns = [
344+ Column ("t1" , int , "INTEGER" ),
345+ Column ("t2" , int , "INTEGER" )],
343346 output_type = "EMITS" ,
344347 output_columns = [Column ("t" , int , "INTEGER" )]
345348 )
349+ executor = UDFMockExecutor ()
346350 exa = MockExaEnvironment (meta )
347- result = executor .run ([Group ([(1 ,), (2 ,), (3 ,), (4 ,), (5 ,), (6 ,)])], exa )
348- assert result == [Group ([(1 ,), ])]
351+ result = executor .run ([Group ([(1 , - 1 ), (2 , - 2 ), (3 , - 3 ), (4 , - 4 )])], exa )
352+ assert result == [Group ([(- 1 ,), ])]
353+
349354
350355def test_emit_tuple_exception ():
351356 def udf_wrapper ():
0 commit comments