Rename the expression. This method allows you to assign a new name to an expression result. This is particularly useful when you want to specify the output column name directly within the expression rather than as a separate parameter. Args: name: The ne
(self, name: str)
| 567 | return self._bin(values, Operation.NOT_IN) |
| 568 | |
| 569 | def alias(self, name: str) -> "Expr": |
| 570 | """Rename the expression. |
| 571 | |
| 572 | This method allows you to assign a new name to an expression result. |
| 573 | This is particularly useful when you want to specify the output column name |
| 574 | directly within the expression rather than as a separate parameter. |
| 575 | |
| 576 | Args: |
| 577 | name: The new name for the expression |
| 578 | |
| 579 | Returns: |
| 580 | An AliasExpr that wraps this expression with the specified name |
| 581 | |
| 582 | Example: |
| 583 | >>> from ray.data.expressions import col, lit |
| 584 | >>> # Create an expression with a new aliased name |
| 585 | >>> expr = (col("price") * col("quantity")).alias("total") |
| 586 | >>> # Can be used with Dataset operations that support named expressions |
| 587 | """ |
| 588 | return AliasExpr( |
| 589 | data_type=self.data_type, expr=self, _name=name, _is_rename=False |
| 590 | ) |
| 591 | |
| 592 | # rounding helpers |
| 593 | def ceil(self) -> "UDFExpr": |