figured it out, the documentation was not intuitive. the custom_field need to be wrapped in json.dumps
import os
import json
ACCESS_TOKEN = input_data['ACCESS_TOKEN']
# Third Party
import requests
API_URL = "https://app.asana.com/api/1.0"
headers = {"Authorization": f"Bearer {ACCESS_TOKEN}"}
url = f"{API_URL}/tasks/{input_data['task_id']}"
obj = json.dumps({input_data['analysis_status_gid']: '1202331527650063'})
body = {"custom_fields" :obj}
r = requests.put(url, headers=headers, data=body)