MCPcopy Create free account
hub / github.com/dask/dask / __bool__

Method __bool__

dask/dataframe/dask_expr/_collection.py:4873–4880  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4871 return f"<dask_expr.expr.Scalar: expr={self.expr}, dtype={self.dtype}>"
4872
4873 def __bool__(self):
4874 raise TypeError(
4875 f"Trying to convert {self} to a boolean value. Because Dask objects are "
4876 "lazily evaluated, they cannot be converted to a boolean value or used "
4877 "in boolean conditions like if statements. Try calling .compute() to "
4878 "force computation prior to converting to a boolean value or using in "
4879 "a conditional statement."
4880 )
4881
4882 def __dask_postcompute__(self):
4883 return first, ()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected