ソースを参照

增加一个用于路径测试的DAG.

wangxq 5 日 前
コミット
7e96cefe90
2 ファイル変更26 行追加0 行削除
  1. 0 0
      dags/__init__.py
  2. 26 0
      dags/check_sys_path_dag.py

+ 0 - 0
dags/__init__.py


+ 26 - 0
dags/check_sys_path_dag.py

@@ -0,0 +1,26 @@
+from airflow import DAG
+from airflow.operators.python import PythonOperator
+from datetime import datetime
+import sys
+
+def print_sys_path():
+    print("=== sys.path 内容如下 ===")
+    for path in sys.path:
+        print(path)
+
+default_args = {
+    'start_date': datetime(2025, 1, 1),
+}
+
+with DAG(
+    dag_id='check_sys_path_dag',
+    default_args=default_args,
+    schedule_interval=None,
+    catchup=False,
+    tags=['debug'],
+) as dag:
+
+    task_print_path = PythonOperator(
+        task_id='print_sys_path',
+        python_callable=print_sys_path
+    )