File tree 2 files changed +13
-8
lines changed
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):
74
74
("q10_returned_item_reporting" , "q10" ),
75
75
pytest .param (
76
76
"q11_important_stock_identification" , "q11" ,
77
- marks = pytest .mark .xfail # https://github.com/apache/datafusion-python/issues/730
78
77
),
79
78
("q12_ship_mode_order_priority" , "q12" ),
80
79
("q13_customer_distribution" , "q13" ),
Original file line number Diff line number Diff line change @@ -320,14 +320,20 @@ fn window(
320
320
window_frame : Option < PyWindowFrame > ,
321
321
ctx : Option < PySessionContext > ,
322
322
) -> 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
+ } )
329
335
} )
330
- } ) ;
336
+ } ;
331
337
if fun. is_none ( ) {
332
338
return Err ( DataFusionError :: Common ( "window function not found" . to_string ( ) ) . into ( ) ) ;
333
339
}
You can’t perform that action at this time.
0 commit comments