<#1339 [Core Feature] flytekit - support positiona...
# flytekit
a
#1339 [Core Feature] flytekit - support positional args when calling tasks Issue created by tekumara Flytekit doesn't support positional args for calling tasks in a workflow, eg:
Copy code
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from flytekit import task, workflow

@dataclass_json
@dataclass
class dc:
    its_a_kind_of:str

@task
def generate_reference_data() -> dc:
    return dc(its_a_kind_of="MAGIC")

@task
def process_reference_data(data: dc) -> str:
    return data.its_a_kind_of

@workflow
def main() -> str:
    reference_data = generate_reference_data()
    # Flyte takes keyword args here only
    return process_reference_data(reference_data)

if __name__ == "__main__":
    print(main())
Will error with
Copy code
flytekit.common.exceptions.user.FlyteAssertion: When calling tasks, only keyword args are supported. Aborting execution as detected 1 positional args (Promise(node:n0.o0),)
Motivation: Why do you think this is important? Supporting positional args would reduce friction when converting existing Python scripts to Flyte workflows. flyteorg/flyte