File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ def check_q17(df):
7474 ("q10_returned_item_reporting" , "q10" ),
7575 pytest .param (
7676 "q11_important_stock_identification" , "q11" ,
77- marks = pytest .mark .xfail # https://github.com/apache/datafusion-python/issues/730
7877 ),
7978 ("q12_ship_mode_order_priority" , "q12" ),
8079 ("q13_customer_distribution" , "q13" ),
Original file line number Diff line number Diff line change @@ -320,14 +320,20 @@ fn window(
320320 window_frame : Option < PyWindowFrame > ,
321321 ctx : Option < PySessionContext > ,
322322) -> PyResult < PyExpr > {
323- let fun = find_df_window_func ( name) . or_else ( || {
324- ctx. and_then ( |ctx| {
325- ctx. ctx
326- . udaf ( name)
327- . map ( WindowFunctionDefinition :: AggregateUDF )
328- . ok ( )
323+ // workaround for https://github.com/apache/datafusion-python/issues/730
324+ let fun = if name == "sum" {
325+ let sum_udf = functions_aggregate:: sum:: sum_udaf ( ) ;
326+ Some ( WindowFunctionDefinition :: AggregateUDF ( sum_udf) )
327+ } else {
328+ find_df_window_func ( name) . or_else ( || {
329+ ctx. and_then ( |ctx| {
330+ ctx. ctx
331+ . udaf ( name)
332+ . map ( WindowFunctionDefinition :: AggregateUDF )
333+ . ok ( )
334+ } )
329335 } )
330- } ) ;
336+ } ;
331337 if fun. is_none ( ) {
332338 return Err ( DataFusionError :: Common ( "window function not found" . to_string ( ) ) . into ( ) ) ;
333339 }
You can’t perform that action at this time.
0 commit comments