Skip to content

[Data] Project fusion drops upstream-only scheduling_strategy and label_selector #68780

Backlog

Description

@raramos9

What happened + What you expected to happen

When two consecutive Project operators (from with_column, with_columns, or select_columns) are fused by ProjectionPushdown, a scheduling_strategy or label_selector set only on the upstream operator is silently dropped.

_try_fuse in python/ray/data/_internal/logical/rules/projection_pushdown.py first checks are_op_remote_args_compatible(upstream_project, downstream_project). That check allows the upstream op to carry the inheritable keys in INHERITABLE_REMOTE_ARGS (scheduling_strategy, label_selector) when the downstream op omits them. But the fused Project is then built with ray_remote_args=downstream_project.ray_remote_args, so those upstream-only keys are lost.

Expected: the fused Project keeps the upstream op's inheritable remote args. Physical operator fusion already does this (ray_remote_args = up_logical_op.ray_remote_args in operator_fusion.py), and so does the logical Filter fusion added in #68625.

Found while reviewing #68625. The author confirmed it on current master in #68625.

Versions / Dependencies

  • Ray master (checked locally at e050aa5)
  • Python 3.11.4, PyArrow 26.0.0, macOS arm64

Reproduction script

import ray
from ray.data._internal.logical.optimizers import LogicalOptimizer
from ray.data.expressions import col

for key, value in [("scheduling_strategy", "SPREAD"), ("label_selector", {"zone": "a"})]:
    ds = (
        ray.data.range(10)
        .with_column("a", col("id") + 1, **{key: value})
        .with_column("b", col("id") + 2)
    )
    before = ds._logical_plan.dag.input_dependencies[0].ray_remote_args
    after = LogicalOptimizer().optimize(ds._logical_plan).dag.ray_remote_args
    print(f"{key}: before={before} after={after}")

Issue Severity

Low: It annoys or frustrates me.

Activity

  1. added
    bug
    triage
    on Dec 3, 2026
  2. PCTEJA commented on Dec 3, 2026

    @PCTEJA
    Contributor

    Hey, nice catch — the repro makes it pretty clear, and the Filter fusion precedent in #68625 points at the fix (carry the upstream inheritable remote args into the fused Project). I was thinking of picking this up. Do you already have a fix locally or were you planning to open a PR yourself? Don't want to duplicate work if you're already on it.

  3. raramos9 commented on Dec 3, 2026

    @raramos9
    ContributorAuthor

    yeah thank you for checking in you can go ahead and pick it up @PCTEJA I have no work towards it currently just wanted to open it up but I'd be happy to be another set of eyes in your PR afterwards if you'd like

  4. PCTEJA commented on Dec 3, 2026

    @PCTEJA
    Contributor

    thanks @raramos9 picking it up

  5. added a commit that references this issue on Dec 3, 2026
    f6ff619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcommunity-backlogdatastabilitytriage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions