Create task & assign it to a section in Python ends up in error

Hello Asana Team,
I’m evaluating Asana API for my organisation.

I want to create a task in a specific section so I’m using memberships and the following code:

result = client.tasks.create_subtask_for_task({
  "data": {
    "name": "API test My Task",
        "project": 1234,
        "section": 5678,


But I receive the error:

File "/home/user/asana/", line 26, in <module>
    "section": 1197543297642289,
  File "/usr/local/lib/python3.6/site-packages/asana/resources/gen/", line 88, in create_subtask_for_task
    path = "/tasks/{task_gid}/subtasks".replace("{task_gid}", task_gid)
TypeError: replace() argument 2 must be str, not dict

What am I doing wrong?