Airflow로 데이터 파이프라인 구축하기
Volker Janz
Senior Developer Advocate at Astronomer
$$
$$

$$
| 오퍼레이터 | 활용 사례 |
|---|---|
ApprovalOperator |
이진 승인/거부 |
HITLBranchOperator |
다음 태스크 선택 |
HITLOperator |
커스텀 옵션 + 폼 |
HITLEntryOperator |
순수 폼 입력, 옵션 없음 |
$$
from airflow.providers.standard.operators.hitl import HITLEntryOperator from airflow.sdk import Paramreview = HITLEntryOperator( task_id="human_review", subject="Review AI draft response", body="{{ ti.xcom_pull(task_ids='generate_draft') }}", params={ "feedback": Param("", type="string"), "urgency": Param("p3", type="string"), }, )
@task def send_response(hitl_output): feedback = hitl_output["params_input"]["feedback"] urgency = hitl_output["params_input"]["urgency"] print(f"Sending response (urgency: {urgency}): {feedback}")draft = generate_draft() chain(draft, review) send_response(review.output)
params_input에 있습니다chosen_options에 있습니다from airflow.providers.standard.operators.hitl import HITLBranchOperatorroute = HITLBranchOperator( task_id="route_complaint", subject="Route customer complaint", body="A customer reported an issue. Choose the responsible team.", options=["Billing Issue", "General Inquiry", "Technical Issue"], options_mapping={ "Billing Issue": "handle_billing", "Technical Issue": "handle_technical", "General Inquiry": "handle_general", }, defaults=["General Inquiry"], )

Airflow로 데이터 파이프라인 구축하기