Skip to content

Commit

Permalink
Nicer read_parquet prefix (#998)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Hoefler <[email protected]>
  • Loading branch information
fjetter and phofl authored Mar 25, 2024
1 parent df0f694 commit cee1ba3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dask_expr/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion dask_expr/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
10 changes: 8 additions & 2 deletions dask_expr/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cee1ba3

Please sign in to comment.