Skip to content

[core] Add a warning when returning an object w/ num_returns=0 #51789

Open
@edoakes

Description

@edoakes

What happened + What you expected to happen

If you set num_returns=0, it is likely a mistake if you return a non-None object. We should print a warning message in this case to avoid confusion.

Here is likely where the warning should go (check outputs):

if num_returns == 0:

Versions / Dependencies

N/A

Reproduction script

>>> import ray
>>> @ray.remote(num_returns=0)
... def f():
...     print('hi')
...     return 123
...
>>> f.remote()
(f pid=44332) hi

Issue Severity

Low: It annoys or frustrates me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issue, but not time-criticalcommunity-backlogcoreIssues that should be addressed in Ray Coregood-first-issueGreat starter issue for someone just starting to contribute to Rayusability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions