2929
3030def test_ffi_table_function_register ():
3131 ctx = SessionContext ()
32- table_func = MyTableFunction (ctx )
32+ table_func = MyTableFunction ()
3333 table_udtf = udtf (table_func , "my_table_func" )
3434 ctx .register_udtf (table_udtf )
3535 result = ctx .sql ("select * from my_table_func()" ).collect ()
@@ -49,7 +49,7 @@ def test_ffi_table_function_register():
4949
5050def test_ffi_table_function_call_directly ():
5151 ctx = SessionContext ()
52- table_func = MyTableFunction (ctx )
52+ table_func = MyTableFunction ()
5353 table_udtf = udtf (table_func , "my_table_func" )
5454
5555 my_table = table_udtf ()
@@ -77,9 +77,6 @@ class PythonTableFunction:
7777 provider, and this function takes no arguments
7878 """
7979
80- def __init__ (self , ctx : SessionContext ) -> None :
81- self ._ctx = ctx
82-
8380 def __call__ (
8481 self , num_cols : Expr , num_rows : Expr , num_batches : Expr
8582 ) -> TableProviderExportable :
@@ -88,7 +85,7 @@ def __call__(
8885 num_rows .to_variant ().value_i64 (),
8986 num_batches .to_variant ().value_i64 (),
9087 ]
91- return MyTableProvider (self . _ctx , * args )
88+ return MyTableProvider (* args )
9289
9390
9491def common_table_function_test (test_ctx : SessionContext ) -> None :
@@ -111,7 +108,7 @@ def common_table_function_test(test_ctx: SessionContext) -> None:
111108
112109def test_python_table_function ():
113110 ctx = SessionContext ()
114- table_func = PythonTableFunction (ctx )
111+ table_func = PythonTableFunction ()
115112 table_udtf = udtf (table_func , "my_table_func" )
116113 ctx .register_udtf (table_udtf )
117114
@@ -130,7 +127,7 @@ def my_udtf(
130127 num_rows .to_variant ().value_i64 (),
131128 num_batches .to_variant ().value_i64 (),
132129 ]
133- return MyTableProvider (ctx , * args )
130+ return MyTableProvider (* args )
134131
135132 ctx .register_udtf (my_udtf )
136133
0 commit comments