Summary
The user is confused about using tasks with variable parameters in Flytekit due to errors encountered. They provide an example of a task function with variable keyword arguments and mention that variable parameters are unsupported, recommending dataclasses instead. The user seeks clarification on how dataclasses can help, particularly in adding new attributes without needing code updates, and questions if this method would allow for creating a task that accepts input from varying numbers of other nodes.
kumare
I guess it can or you can simply pass a dict right
denis.shvetsov
Does it help me, if I want a task, that can have input from different amount of other nodes?
kumare
As in you can add new attributes to a data class without having to update your code
denis.shvetsov
Could you elaborate how dataclasses can help me?
kumare
Variable parameters not supported please use dataclasses
denis.shvetsov
Apparently variable parameters are not supported yet. At least I get errors from https://github.com/flyteorg/flytekit/blob/master/flytekit/core/promise.py#L1282-L1290|here.
david.espejo
flytekit <https://github.com/flyteorg/flytekit/pull/2522|supports positional args>, but not sure if already covers variable parameters
denis.shvetsov
Hi, tasks with variable parameters are possible, impossible, not-recommended?
Something like
def jsonify(**args: str) -> str:
return json.dumps(str)```