suppress new_user_task_lists warning message

Been looking everywhery, still can’t figure this out. How to suppress new_user_task_lists in python ?
UserWarning: This request is affected by the “new_user_task_lists” deprecation. Please visit this url for more info: Update on our planned API changes to user task lists (a.k.a. My Tasks)
Adding “new_user_task_lists” to your “Asana-Enable” or “Asana-Disable” header will opt in/out to this deprecation and suppress this warning.
warnings.warn(message)

my code looks like this

client = asana.Client.access_token(TOKEN)
result = client.tasks.create_task(body, opt_pretty=True)

You need to do this
Adding “new_user_task_lists” to your “Asana-Enable” or “Asana-Disable” header will opt in/out to this deprecation and suppress this warning.

Read the doc regarding deprecation to get details

i found this Asana but its not telling me where and how to do this.

Here is how I do it with the nodeJS library

Asana.Client.create({
      clientId: XXXXX,
      redirectUri: XXXXX,
      defaultHeaders: { 'Asana-Enable': 'string_ids' }
    })

With python i dont use create(), but instead i use access_token() which only take one parameter, token.

1 Like

Here’s how to do it in Python:

2 Likes

Amazing! Thanks

1 Like