You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/06/19 23:34:53 UTC

[GitHub] [airflow-client-python] potiuk commented on issue #85: Airflow Python Client 2.6.2rc1 "get_tasks" errors out with execution_timeout cannot be None

potiuk commented on issue #85:
URL: https://github.com/apache/airflow-client-python/issues/85#issuecomment-1597876425

   OK. Found it.
   
   It looks like in the past it's been manually patched (maybe @ephraimbuddy remembers more):
   
   https://github.com/apache/airflow-client-python/commit/ddd6fc0545a8066f474c765e1644a5202eebd256
   
   I do not know that much about OpenAPI specs, but I think it's not a bug in generatio, but the issue is that our OpenAPI specification is wrong:
   
   ```
           execution_timeout:
             $ref: '#/components/schemas/TimeDelta'
             nullable: true
           retry_delay:
             $ref: '#/components/schemas/TimeDelta'
             nullable: true
   ```
   
   Should be:
   
   ```
           execution_timeout:
             anyOf:
               - type: 'null'   # Note the quotes around 'null'
               - $ref: '#/components/schemas/TimeDelta'
           retry_delay:
             anyOf:
               - type: 'null'   # Note the quotes around 'null'
               - $ref: '#/components/schemas/TimeDelta'
   ```
   
   This generates this code in models/task.py
   
   ```
               'execution_timeout': (bool, date, datetime, dict, float, int, list, str, none_type,),  # noqa: E501
               'retry_delay': (bool, date, datetime, dict, float, int, list, str, none_type,),  # noqa: E501
   ```
   
   Which seems pretty expected.
   
   We could again apply manual fix, but maybe more reasonable is to correct the specification.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org