milenkovicm commented on issue #1142:
URL: 
https://github.com/apache/datafusion-ballista/issues/1142#issuecomment-2516839714

   > 
   > I don’t have my computer this weekend so I can’t test to verify but you 
may get unblocked if you do `ctx = SessionContext(ctx)`
   > 
   
   I finally got some time to try this, but unfortunately no luck, no such 
function. 
   
   I tried variation of the proposal wrapping DataFrame,  but same error 
   
   
   ```python
   from ballista import BallistaBuilder
   # from datafusion.context import SessionContext
   from datafusion import functions as f
   from datafusion.dataframe import DataFrame
   
   
   ctx = BallistaBuilder()\
       .standalone()
   
   df = ctx.sql("SELECT 1 as r")
   
   df0 = DataFrame(df)
   df0.aggregate(
       [f.col("r")], [f.count_star()]
   )
   df0.show()
   ```
   
   ```
   TypeError                                 Traceback (most recent call last)
   Cell In[4], [line 14](vscode-notebook-cell:?execution_count=4&line=14)
        [11](vscode-notebook-cell:?execution_count=4&line=11) df = 
ctx.sql("SELECT 1 as r")
        [13](vscode-notebook-cell:?execution_count=4&line=13) df0 = 
DataFrame(df)
   ---> [14](vscode-notebook-cell:?execution_count=4&line=14) df0.aggregate(
        [15](vscode-notebook-cell:?execution_count=4&line=15)     [f.col("r")], 
[f.count_star()]
        [16](vscode-notebook-cell:?execution_count=4&line=16) )
        [17](vscode-notebook-cell:?execution_count=4&line=17) df0.show()
   
   File 
~/git/arrow-ballista/python/venv/lib/python3.12/site-packages/datafusion/dataframe.py:197,
 in DataFrame.aggregate(self, group_by, aggs)
       
[195](https://file+.vscode-resource.vscode-cdn.net/Users/marko/git/arrow-ballista/python/~/git/arrow-ballista/python/venv/lib/python3.12/site-packages/datafusion/dataframe.py:195)
 group_by = [e.expr for e in group_by]
       
[196](https://file+.vscode-resource.vscode-cdn.net/Users/marko/git/arrow-ballista/python/~/git/arrow-ballista/python/venv/lib/python3.12/site-packages/datafusion/dataframe.py:196)
 aggs = [e.expr for e in aggs]
   --> 
[197](https://file+.vscode-resource.vscode-cdn.net/Users/marko/git/arrow-ballista/python/~/git/arrow-ballista/python/venv/lib/python3.12/site-packages/datafusion/dataframe.py:197)
 return DataFrame(self.df.aggregate(group_by, aggs))
   ```
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to