본문 바로가기
Bigdata/Airflow

AttributeError: 'HttpHook' object has no attribute 'update_relative'

by 빅경 2025. 2. 23.
728x90
반응형

dag 선언하는 구문에 hook을 선언해 발생 

with DAG(
)as dag:
    task = HttpHook(http_conn_id='httpHook', method="GET")
    res = task3.run(
        endpoint='/actions/2'
    )

 

함수에 선언해서 pythonOperator로 호출하는 방식으로 변경해야 함

def my_python_function():
    hook = HttpHook(http_conn_id='my_conn',method='GET')
    res = hook.run(
        endpoint='/endpoint'
    )

with Dag(
) as dag:
    # PythonOperator 정의
    python_task = PythonOperator(task_id='python_task', python_callable=my_python_function)
728x90
반응형