#49207·ray

[data] ObjectRefs passed to map UDF are not automatically deref'ed

Author: raulchenCreated Dec 11, 2024Updated Sep 17, 2026
LabelsbugP1triagedatacommunity-backlog

When users pass an ObjectRef as a UDF parameter. It's supposed to be automatically deref'ed

python

def map_fn(arg):
  # The following is broken right now.
  #  assert arg == 1
  # Instead, users need to use
  arg = ray.get(arg)

arg_ref = ray.put(1)
ds.map(map_fn, fn_args=[arg_ref])

This bug hurts both user experience and performance. Because the UDF arguments are not passed as the Ray task arguments. So Ray Scheduler doesn't know if the arguments are ready or not, before scheduling the tasks.