Re: Failed to unit test PyFlink UDF

2021-03-23 Thread Yik San Chan
gt;>>>> Best, >>>>> Yik San >>>>> >>>>> On Tue, Mar 23, 2021 at 1:29 PM Dian Fu wrote: >>>>> >>>>>> H Yik San, >>>>>> >>>>>> As the udf `add` is decorated with `@udf` decorator

Re: Failed to unit test PyFlink UDF

2021-03-23 Thread Dian Fu
it is no longer a >> simple Python function if you reference `add`. If you execute >> `print(type(add(1, 1)))`, you will see the output is something like "> 'pyflink.table.expression.Expression'>". >> >> You could try the following code: assert add._func

Re: Failed to unit test PyFlink UDF

2021-03-23 Thread Yik San Chan
decorator, it is no longer a >>>>> simple Python function if you reference `add`. If you execute >>>>> `print(type(add(1, 1)))`, you will see the output is something like >>>>> ">>>> 'pyflink.table.expression.Expression'>&q

Re: Failed to unit test PyFlink UDF

2021-03-23 Thread Dian Fu
on. > > Regards, > Dian > > On Tue, Mar 23, 2021 at 10:56 AM Yik San Chan <mailto:evan.chanyik...@gmail.com>> wrote: > (This question is cross-posted on StackOverflow > https://stackoverflow.com/questions/66756612/failed-to-unit-test-pyflink-udf > <ht

Re: Failed to unit test PyFlink UDF

2021-03-22 Thread Yik San Chan
t;>>> 'pyflink.table.expression.Expression'>". >>>> >>>> You could try the following code: assert add._func(1, 1) == 3 >>>> >>>> add._func returns the original Python function. >>>> >>>> Regards, >>>

Re: Failed to unit test PyFlink UDF

2021-03-22 Thread Dian Fu
n function. >>> >>> Regards, >>> Dian >>> >>> On Tue, Mar 23, 2021 at 10:56 AM Yik San Chan >>> wrote: >>> >>>> (This question is cross-posted on StackOverflow >>>> https://stackoverflow.com/questions/

Re: Failed to unit test PyFlink UDF

2021-03-22 Thread Yik San Chan
t;> >> On Tue, Mar 23, 2021 at 10:56 AM Yik San Chan >> wrote: >> >>> (This question is cross-posted on StackOverflow >>> https://stackoverflow.com/questions/66756612/failed-to-unit-test-pyflink-udf >>> ) >>> >>> I am usin

Re: Failed to unit test PyFlink UDF

2021-03-22 Thread Yik San Chan
1 at 10:56 AM Yik San Chan > wrote: > >> (This question is cross-posted on StackOverflow >> https://stackoverflow.com/questions/66756612/failed-to-unit-test-pyflink-udf >> ) >> >> I am using PyFlink and I want to unit test my UDF written in Python. >>

Re: Failed to unit test PyFlink UDF

2021-03-22 Thread Dian Fu
nc returns the original Python function. Regards, Dian On Tue, Mar 23, 2021 at 10:56 AM Yik San Chan wrote: > (This question is cross-posted on StackOverflow > https://stackoverflow.com/questions/66756612/failed-to-unit-test-pyflink-udf > ) > > I am using PyFlink and I want to un

Failed to unit test PyFlink UDF

2021-03-22 Thread Yik San Chan
(This question is cross-posted on StackOverflow https://stackoverflow.com/questions/66756612/failed-to-unit-test-pyflink-udf ) I am using PyFlink and I want to unit test my UDF written in Python. To test the simple udf below: ```python # tasks/helloworld/udf.py from pyflink.table import