simicd commented on code in PR #258:
URL: 
https://github.com/apache/arrow-datafusion-python/pull/258#discussion_r1125560690


##########
datafusion/__init__.py:
##########
@@ -190,7 +190,7 @@ def udaf(accum, input_type, return_type, state_type, 
volatility, name=None):
             "`accum` must implement the abstract base class Accumulator"
         )
     if name is None:
-        name = accum.__qualname__
+        name = accum.__qualname__.lower()

Review Comment:
   Previously calling the UDAF in SQL would fail if `name` is not specified 
(i.e. both `MyAccumulator(b)` and `myaccumulator(b)` would fail when running 
e.g. `result_df = ctx.sql(f"select a, myaccumulator(b) as b_aggregated from 
{table_name}")` ). With this change both the uppercase & lowercase variant will 
work.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to