Skip to content

[Bug] - Dask arrays don't support item() #1830

@JoerivanEngelen

Description

@JoerivanEngelen

Bug description
@jdelsman ran into this.

Dask arrays do not support the item method.
In his case, he could fix this by commenting out the call to item:

def is_empty_dataarray(da: Any) -> bool:
    return isinstance(da, xr.DataArray) and da.isnull().all()#.item()

I have to backtrack again why the call to .item was necessary here: Was it introduced because it is necessary in some cases, or was it because of a mypy error?

We also need to test more with dask array fixtures to catch these bugs.

Related to #281 and #1682

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeltaresIssue appeared in Deltares projectbugSomething isn't working

    Type

    Projects

    Status

    📯 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions