Garrett Weaver
07/28/2025, 5:33 PMdaft.exceptions.DaftCoreException: Not Yet Implemented: Window functions are currently only supported on the native runner. A small test with new engine on seems to work, but want to make sure there are not any caveats.Garrett Weaver
07/28/2025, 5:33 PMimport daft
import daft.context
import ray
from daft.functions import row_number
ray.init(num_cpus=4)
daft.context.set_runner_ray(noop_if_initialized=True)
daft.set_execution_config(use_experimental_distributed_engine=False)
df = daft.from_pydict(
{
"id": [1, 2, 3, 4],
"grp": ["grp1", "grp1", "grp2", "grp2"],
"value": ["a", "b", "c", "d"],
}
)
df2 = df.with_column(
"rn",
row_number()
.over(daft.Window().partition_by("grp").order_by("value"))
.alias("row_num"),
)
df2.join(df2, on="id").show()Colin Ho
07/28/2025, 6:17 PMpartition_by , all the data will be coalesced to a single machine. We will be working on optimizing this soonColin Ho
07/28/2025, 6:20 PMGarrett Weaver
07/28/2025, 6:20 PMGarrett Weaver
07/28/2025, 6:21 PMColin Ho
07/28/2025, 6:23 PM