Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 字符串函数不';t在气流中处理{run_id}}_Python_Airflow - Fatal编程技术网

Python 字符串函数不';t在气流中处理{run_id}}

Python 字符串函数不';t在气流中处理{run_id}},python,airflow,Python,Airflow,我有一个DAG包含 run_id = "{{ run_id }}" session_id = str(run_id).replace(":","-").replace("+","-") 当我运行dag并打印会话id时,我得到: manual__2021-05-07T08:28:31.651045+00:00 所以很明显,替换函数不起作用 当我执行这样的代码时: run_id = "m

我有一个DAG包含

run_id = "{{ run_id }}"
session_id = str(run_id).replace(":","-").replace("+","-")
当我运行dag并打印会话id时,我得到:

manual__2021-05-07T08:28:31.651045+00:00
所以很明显,替换函数不起作用

当我执行这样的代码时:

run_id = "manual__2021-05-07T08:28:31.651045+00:00"
session_id = str(run_id).replace(":","-").replace("+","-")
它工作并返回

manual__2021-05-07T08-28-31.651045-00-00
为什么它不能与
{{run\u id}}
一起工作? 我卡住了。有什么提示吗

气流2.0

问候 帕维尔