dask / dask-expr

BSD 3-Clause "New" or "Revised" License
83 stars 22 forks source link

Dataframe `shape` returns a float #1042

Closed SaravananSathyanandhaQC closed 5 months ago

SaravananSathyanandhaQC commented 5 months ago

Describe the issue:

Dataframe.shape returns a float for the first element (number of rows)

https://github.com/dask/dask-expr/blob/9e0c4dbcb2007b07ef2cd35bde551da32f5bf882/dask_expr/_collection.py#L2638

Minimal Complete Verifiable Example:

# Put your MCVE code here
from dask import dataframe
import pandas as pd
ddf = dataframe.from_pandas(pd.DataFrame({"id": [1,2,3], "field": ["alpha", "beta", "delta"]}), chunksize=2)
print(ddf.shape[0].compute())

Anything else we need to know?: Wasn't an issue at least in 2024.2.1 but I haven't had a chance to bisect further

Environment: