Commit bf063b09 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

test python operator

parent 2094680d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ with DAG(
    process_task = PythonOperator(
        task_id="process_observation_data",
        python_callable=process_observation,
        provide_context=True,  # 关键!启用上下文传递
    )

    t1 = BashOperator(
+0 −2
Original line number Diff line number Diff line
from ._args import TRIGGER_DEFAULT_ARGS

# from ._utils import get_run_id_task
+0 −14
Original line number Diff line number Diff line
# from airflow.providers.standard.operators.python import PythonOperator
#
#
# def get_run_id(**context):
#     # 从上下文中直接获取 dag_run_id
#     current_run_id = context["dag_run"].run_id
#     print(f"Current run_id: {current_run_id}")
#
#
# get_run_id_task = PythonOperator(
#     task_id="get_dag_run_id",
#     python_callable=get_run_id,
#     provide_context=True,  # Airflow 2.x 默认启用,可省略
# )