-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parent of chained task returning tuple #29
Labels
bug
Something isn't working
Comments
def cool():
return 34, "name"
def run(*args, **kwargs):
print(args, kwargs)
return_value = cool()
## what we are currently doing
>>> run(return_value)
((34, 'name'),) {}
## versus what I think we ought to do
>>> run(*return_value)
(34, 'name') {}
>>> |
however, think of situation where: import typing
def run(value: typing.Tuple, **kwargs):
print(value, kwargs) ie, in such a case ## what we are currently doing
>>> run(return_value)
(34, 'name') {}
## versus what I think we ought to do
>>> run(*return_value)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: run() takes 1 positional argument but 2 were given so we haven't made the situation any better. |
this is the way celery does it; https://github.com/celery/celery/blob/e2161783e1a4cb021cd37d5df8581f7729f9095c/celery/app/trace.py#L439-L446 |
I think, we'll leave it as is for now. |
I'm labelling this as a bug since it might be surprising for people using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, if we have a chained task, we use the return_value of the parent to queue the child:
wiji/wiji/worker.py
Lines 183 to 186 in e9da8ef
However, what happens if
return_value
is a tuple?I think in that case, we ought to;
ie only if
return_value
is a tupleThe text was updated successfully, but these errors were encountered: