From 1e79286bf76488b69b8bcb0d910efd3563671d83 Mon Sep 17 00:00:00 2001 From: fjetter Date: Mon, 25 Mar 2024 07:02:36 +0100 Subject: [PATCH 1/2] Nicer read_parquet prefix --- dask_expr/io/parquet.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dask_expr/io/parquet.py b/dask_expr/io/parquet.py index 814d54fb..950bc3b4 100644 --- a/dask_expr/io/parquet.py +++ b/dask_expr/io/parquet.py @@ -633,10 +633,8 @@ def columns(self): @cached_property def _name(self): - return ( - funcname(type(self)).lower() - + "-" - + _tokenize_deterministic(self.checksum, *self.operands[:-1]) + return "read_parquet-" + _tokenize_deterministic( + funcname(type(self)), self.checksum, *self.operands[:-1] ) @property From 9f7a417b8860b3aada5d516d3ad7f8c79a0d7de8 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Mon, 25 Mar 2024 11:53:58 -0500 Subject: [PATCH 2/2] Fixup failing tests --- dask_expr/_core.py | 8 +++++--- dask_expr/io/io.py | 2 +- dask_expr/io/parquet.py | 12 ++++++++++-- 3 files changed, 16 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 950bc3b4..a53eac71 100644 --- a/dask_expr/io/parquet.py +++ b/dask_expr/io/parquet.py @@ -631,10 +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 "read_parquet-" + _tokenize_deterministic( - funcname(type(self)), self.checksum, *self.operands[:-1] + return ( + self._funcname + + "-" + + _tokenize_deterministic( + funcname(type(self)), self.checksum, *self.operands[:-1] + ) ) @property