Skip to content

[Data] Compute Expressions-Expr Rounding#59295

Merged
alexeykudinkin merged 2 commits intoray-project:masterfrom
myandpr:compute-expressions-expr
Dec 17, 2025
Merged

[Data] Compute Expressions-Expr Rounding#59295
alexeykudinkin merged 2 commits intoray-project:masterfrom
myandpr:compute-expressions-expr

Conversation

@myandpr
Copy link
Copy Markdown
Member

@myandpr myandpr commented Dec 9, 2025

Description

Completing the Expr (direct) Rounding operations (ceil, floor, round, trunc)

for example:

import ray
from ray.data import from_items
from ray.data.expressions import col

ray.init(include_dashboard=False, ignore_reinit_error=True)
ds = from_items([{"x": 1.1}, {"x": 2.5}, {"x": -3.7}])
for row in ds.iter_rows():
    print(row)

x_expr = col("x")
hasattr(x_expr, "ceil")
ds = ds.with_column("x_ceil", x_expr.ceil())
hasattr(x_expr, "floor")
ds = ds.with_column("x_floor", x_expr.floor())
hasattr(x_expr, "round")
ds = ds.with_column("x_round", x_expr.round())
hasattr(x_expr, "trunc")
ds = ds.with_column("x_trunc", x_expr.trunc())
for row in ds.iter_rows():
    print(row)

Related issues

Related to #58674

Additional information

@myandpr myandpr requested a review from a team as a code owner December 9, 2025 08:47
Signed-off-by: yaommen <myanstu@163.com>
@myandpr myandpr force-pushed the compute-expressions-expr branch from 94c1046 to 7081bb0 Compare December 9, 2025 09:43
@ray-gardener ray-gardener bot added data Ray Data-related issues community-contribution Contributed by the community labels Dec 9, 2025
@myandpr
Copy link
Copy Markdown
Member Author

myandpr commented Dec 10, 2025

Hi, @goutamvenkat-anyscale ,Could you please review this PR when you have time?many thanks

@richardliaw
Copy link
Copy Markdown
Contributor

hey @myandpr, thanks a bunch for the contribution! if you're interested in chatting more with the contributors, feel free to join our community sync -- https://docs.google.com/forms/d/e/1FAIpQLSeYWjNExnr6gbhO5rpM0i6wm4TBTdsm3y5S0LR8Syzk_2gelQ/viewform

@myandpr
Copy link
Copy Markdown
Member Author

myandpr commented Dec 10, 2025

hey @myandpr, thanks a bunch for the contribution! if you're interested in chatting more with the contributors, feel free to join our community sync -- https://docs.google.com/forms/d/e/1FAIpQLSeYWjNExnr6gbhO5rpM0i6wm4TBTdsm3y5S0LR8Syzk_2gelQ/viewform

@richardliaw Submitted the form! Looking forward to the next sync meeting.Looking forward to contributing more and learning from everyone.

@edoakes
Copy link
Copy Markdown
Collaborator

edoakes commented Dec 12, 2025

@bveeramani PTAL

@goutamvenkat-anyscale goutamvenkat-anyscale added the go add ONLY when ready to merge, run all tests label Dec 16, 2025
Copy link
Copy Markdown
Contributor

@goutamvenkat-anyscale goutamvenkat-anyscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Just a few comments

Copy link
Copy Markdown
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than Goutam's suggestions

Signed-off-by: yaommen <myanstu@163.com>
Copy link
Copy Markdown
Contributor

@goutamvenkat-anyscale goutamvenkat-anyscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks

@alexeykudinkin alexeykudinkin merged commit b56deca into ray-project:master Dec 17, 2025
6 checks passed
zzchun pushed a commit to zzchun/ray that referenced this pull request Dec 18, 2025
### Description
Completing the Expr (direct) Rounding operations (ceil, floor, round,
trunc)

for example:
```
import ray
from ray.data import from_items
from ray.data.expressions import col

ray.init(include_dashboard=False, ignore_reinit_error=True)
ds = from_items([{"x": 1.1}, {"x": 2.5}, {"x": -3.7}])
for row in ds.iter_rows():
    print(row)

x_expr = col("x")
hasattr(x_expr, "ceil")
ds = ds.with_column("x_ceil", x_expr.ceil())
hasattr(x_expr, "floor")
ds = ds.with_column("x_floor", x_expr.floor())
hasattr(x_expr, "round")
ds = ds.with_column("x_round", x_expr.round())
hasattr(x_expr, "trunc")
ds = ds.with_column("x_trunc", x_expr.trunc())
for row in ds.iter_rows():
    print(row)
```


### Related issues
Related to ray-project#58674

### Additional information

---------

Signed-off-by: yaommen <myanstu@163.com>
Co-authored-by: yanmin <homeryan@didiglobal.com>
Yicheng-Lu-llll pushed a commit to Yicheng-Lu-llll/ray that referenced this pull request Dec 22, 2025
### Description
Completing the Expr (direct) Rounding operations (ceil, floor, round,
trunc)

for example:
```
import ray
from ray.data import from_items
from ray.data.expressions import col

ray.init(include_dashboard=False, ignore_reinit_error=True)
ds = from_items([{"x": 1.1}, {"x": 2.5}, {"x": -3.7}])
for row in ds.iter_rows():
    print(row)

x_expr = col("x")
hasattr(x_expr, "ceil")
ds = ds.with_column("x_ceil", x_expr.ceil())
hasattr(x_expr, "floor")
ds = ds.with_column("x_floor", x_expr.floor())
hasattr(x_expr, "round")
ds = ds.with_column("x_round", x_expr.round())
hasattr(x_expr, "trunc")
ds = ds.with_column("x_trunc", x_expr.trunc())
for row in ds.iter_rows():
    print(row)
```


### Related issues
Related to ray-project#58674

### Additional information

---------

Signed-off-by: yaommen <myanstu@163.com>
Co-authored-by: yanmin <homeryan@didiglobal.com>
peterxcli pushed a commit to peterxcli/ray that referenced this pull request Feb 25, 2026
### Description
Completing the Expr (direct) Rounding operations (ceil, floor, round,
trunc)

for example:
```
import ray
from ray.data import from_items
from ray.data.expressions import col

ray.init(include_dashboard=False, ignore_reinit_error=True)
ds = from_items([{"x": 1.1}, {"x": 2.5}, {"x": -3.7}])
for row in ds.iter_rows():
    print(row)

x_expr = col("x")
hasattr(x_expr, "ceil")
ds = ds.with_column("x_ceil", x_expr.ceil())
hasattr(x_expr, "floor")
ds = ds.with_column("x_floor", x_expr.floor())
hasattr(x_expr, "round")
ds = ds.with_column("x_round", x_expr.round())
hasattr(x_expr, "trunc")
ds = ds.with_column("x_trunc", x_expr.trunc())
for row in ds.iter_rows():
    print(row)
```

### Related issues
Related to ray-project#58674

### Additional information

---------

Signed-off-by: yaommen <myanstu@163.com>
Co-authored-by: yanmin <homeryan@didiglobal.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants