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
Add Ability to overwrite task settings when calling a task in Functional API #717
Comments
Just throwing this out there, but another option would be some sugar like: t = MyTask(name="test task", tags=["A"])
with Flow() as f:
res1 = t["one"](1)
res2 = t["two"](2) which could be used to rename the individual tasks This would mean the current The reason I'm suggesting this different idea is that I think the documentation for the special kwargs to |
This Also, this would only solve the issue for names, not for other attributes like triggers. If the issue is documentation, then we need to add more. |
Right, but I suspect names will be the only thing people really use this for, which is why I was trying to brainstorm a leaner version than new_task = old_task(a, b, c, y, _task_args={"name": "new_task"}) which feels clunky to me, and is attempting to solve a more general problem than the one we know about (names in the UI). For things like triggers, retries, etc. I think people will simply create new task instances because at that point the underlying task is probably fundamentally different anyway. But, if we think a reserved kwarg is the way to go, then I suppose adding one layer of depth to the argument for the sake of supporting a more general pattern isn't so bad. |
I think this feature is going to add a lot of utility to |
Good point 👍🏻👍🏻 |
Implement api services and subscribe composition
Currently, a common pattern is:
and each individual copied instance of the task will appear with the same name
"test task"
in the UI and any other place that information is surfaced.To allow for more nuanced control of the copying of tasks, we should add a reserved kwarg
_task_args
to task call signatures which allow for overriding things (such asname
) when calling / copying the task.The text was updated successfully, but these errors were encountered: