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

Method __repr__

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

Source from the content-addressed store, hash-verified

467 return type(self).__name__, self._expr._name
468
469 def __repr__(self):
470 data = self._repr_data().to_string(max_rows=5)
471 _str_fmt = """Dask {klass} Structure:
472{data}
473Dask Name: {name}, {n_expr}
474Expr={expr}"""
475 if not isinstance(self, Series) and not len(self.columns):
476 data = data.partition("\n")[-1].replace("Index", "Divisions")
477 _str_fmt = f"Empty {_str_fmt}"
478 n_expr = len({e._name for e in self.expr.walk()})
479
480 return _str_fmt.format(
481 klass=self.__class__.__name__,
482 data=data,
483 name=key_split(self._name),
484 n_expr=maybe_pluralize(n_expr, "expression"),
485 expr=self.expr,
486 )
487
488 def __bool__(self):
489 raise ValueError(

Callers

nothing calls this directly

Calls 6

_repr_dataMethod · 0.95
key_splitFunction · 0.90
maybe_pluralizeFunction · 0.90
to_stringMethod · 0.45
replaceMethod · 0.45
walkMethod · 0.45

Tested by

no test coverage detected