Skip to content

[Data] Compute Expressions-Expr Rounding#59295

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

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

Conversation

@myandpr

@myandpr myandpr commented Dec 9, 2025

Copy link
Copy Markdown
Member

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
Comment thread python/ray/data/tests/test_with_column.py Outdated
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

myandpr commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

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

myandpr commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

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

edoakes commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator
@goutamvenkat-anyscale goutamvenkat-anyscale added the go add ONLY when ready to merge, run all tests label Dec 16, 2025
Comment thread python/ray/data/tests/test_with_column.py Outdated
Comment thread python/ray/data/expressions.py Outdated

@goutamvenkat-anyscale goutamvenkat-anyscale left a comment

Copy link
Copy Markdown
Contributor

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

@bveeramani bveeramani left a comment

Copy link
Copy Markdown
Member

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>

@goutamvenkat-anyscale goutamvenkat-anyscale left a comment

Copy link
Copy Markdown
Contributor

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
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

7 participants