dask-contrib / dask-sql

Distributed SQL Engine in Python using Dask
https://dask-sql.readthedocs.io/
MIT License
376 stars 71 forks source link

[BUG] on Starter example #1315

Open tiraldj opened 3 months ago

tiraldj commented 3 months ago

<Easy to fix. On https://dask-sql.readthedocs.io/en/latest/ in the Example code the last line is

# ...or use it for another computation
result.sum.mean().compute()

this throws an error because 'sum' was accidentally left in.

the code should be:

# ...or use it for another computation
result.mean().compute()
ayushdg commented 3 months ago

Thanks for raising @tiraldj, it looks like the sql query creates a column called sum but it cannot be accessed via result.sum since that's a reserved for the function sum. Like you mentioned result.mean().compute() or result["sum"].mean().compute() probably accomplish what the example is going for. @tiraldj is this something you would be comfortable in submitting a PR for? It's okay if you can't as well 😄 .