Infra
[airflow] airflow-client-python 2.6.0 이하버전 airflow_client.client.exceptions.ApiTypeError: Invalid type for variable 'dag_run_timeout'
waterfogsw
2023. 5. 16. 11:22
def get_dag_detail(cls, dag_id: str):
with client.ApiClient(airflow_config) as api_client:
api_instance = dag_api.DAGApi(api_client)
api_instance.get_dag_details(dag_id=dag_id)
위와같이 apache airflow python client 를 활용해 dag_detail을 조회하는 경우
dag_run_timeout이 null이면
airflow_client.client.exceptions.ApiTypeError: Invalid type for variable 'dag_run_timeout'. Required value type is TimeDelta and passed type was NoneType at ['received_data']['dag_run_timeout']
와 같은 에러가 발생한다.
dag_detail.py파일을 보면
…
'start_date': (datetime, none_type,), # noqa: E501
'dag_run_timeout': (TimeDelta,), # noqa: E501
'doc_md': (str, none_type,), # noqa: E501
…
dag_run_timeout이 Required Parameter가 아님에도 불구하고 TimeDelta 타입만 허용되어있어서 발생하는문제인데
…
'start_date': (datetime, none_type,), # noqa: E501
'dag_run_timeout': (TimeDelta, none_type), # noqa: E501
'doc_md': (str, none_type,), # noqa: E501
…
2023/05/16 현재 위와 같이 수정하는 PR(https://github.com/apache/airflow-client-python/pull/76)이 머지되었으니 릴리즈 될때까지 조금만 기다리자.