airflow-client-python
airflow-client-python copied to clipboard
get_tasks api is broken
Client version: 2.1.0
Code:
dag_id = "example_bash_operator"
try:
api_response = dag_api_instance.get_tasks(dag_id)
pprint(api_response)
except airflow_client.client.exceptions.OpenApiException as e:
print("Exception when calling DagAPI->get_tasks: %s\n" % e)
Error:
Exception when calling DagAPI->get_tasks: Invalid type for variable 'execution_timeout'. Required value type is TimeDelta and passed type was NoneType at ['received_data']['tasks'][0]['execution_timeout']
@msumit do you have any idea why this is? I am running into this problem still on the latest version (2.2.0).
Isn't this a bug upstream? 🤔 I have the feeling the open api spec should allow execution_timeout to be Optional, no?
As a workaround you can set _check_return_type=False in get_tasks.
Closing, solved. Up to now we had to manually cherry pick some patches at released time. 2.7.0 does not have this issue.