From e1f6ef3ef8a43bc0ae6e62a665e1b0beb2d50e92 Mon Sep 17 00:00:00 2001 From: Hendrik Makait Date: Mon, 19 Feb 2024 19:13:07 +0100 Subject: [PATCH] Core --- dask_expr/_core.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dask_expr/_core.py b/dask_expr/_core.py index 69f341de..e04f80f4 100644 --- a/dask_expr/_core.py +++ b/dask_expr/_core.py @@ -12,6 +12,7 @@ from dask.dataframe.core import is_dataframe_like, is_index_like, is_series_like from dask.utils import funcname, import_required, is_arraylike +from dask_expr._diagnostics import explain from dask_expr._util import _BackendData, _tokenize_deterministic @@ -111,6 +112,21 @@ def _tree_repr_lines(self, indent=0, recursive=True): def tree_repr(self): return os.linesep.join(self._tree_repr_lines()) + def _explain_label(self): + return "".join( + [ + "<{", + funcname(type(self)), + " | ", + "npartitions: ", + str(self.npartitions), + "}>", + ] + ) + + def explain(self, fuse: bool = True) -> None: + explain(self, fuse) + def pprint(self): for line in self._tree_repr_lines(): print(line)