From cee1ba3667ccc09162850bca183a013357059a1d Mon Sep 17 00:00:00 2001 From: Florian Jetter Date: Mon, 25 Mar 2024 18:06:31 +0100 Subject: [PATCH] Nicer read_parquet prefix (#998) Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com> --- dask_expr/_core.py | 8 +++++--- dask_expr/io/io.py | 2 +- dask_expr/io/parquet.py | 10 ++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dask_expr/_core.py b/dask_expr/_core.py index 301c26ab..0f80da1b 100644 --- a/dask_expr/_core.py +++ b/dask_expr/_core.py @@ -442,11 +442,13 @@ def lower_completely(self) -> Expr: def _lower(self): return + @functools.cached_property + def _funcname(self): + return funcname(type(self)).lower() + @functools.cached_property def _name(self): - return ( - funcname(type(self)).lower() + "-" + _tokenize_deterministic(*self.operands) - ) + return self._funcname + "-" + _tokenize_deterministic(*self.operands) @property def _meta(self): diff --git a/dask_expr/io/io.py b/dask_expr/io/io.py index ffff71a8..918fab53 100644 --- a/dask_expr/io/io.py +++ b/dask_expr/io/io.py @@ -103,7 +103,7 @@ class FusedIO(BlockwiseIO): @functools.cached_property def _name(self): return ( - funcname(type(self.operand("_expr"))).lower() + self.operand("_expr")._funcname + "-fused-" + _tokenize_deterministic(*self.operands) ) diff --git a/dask_expr/io/parquet.py b/dask_expr/io/parquet.py index 814d54fb..a53eac71 100644 --- a/dask_expr/io/parquet.py +++ b/dask_expr/io/parquet.py @@ -631,12 +631,18 @@ def columns(self): else: return _convert_to_list(columns_operand) + @cached_property + def _funcname(self): + return "read_parquet" + @cached_property def _name(self): return ( - funcname(type(self)).lower() + self._funcname + "-" - + _tokenize_deterministic(self.checksum, *self.operands[:-1]) + + _tokenize_deterministic( + funcname(type(self)), self.checksum, *self.operands[:-1] + ) ) @property