小编Jus*_*ase的帖子

生成 uuid 并在 Airflow DAG 中使用它

我正在尝试创建一个具有以下 2 个任务的动态气流:任务 1:使用生成的 UUID 作为其名称的一部分创建文件任务 2:对这些文件运行检查

所以我定义了一个变量“FILE_UUID”并将其设置如下:str(uuid.uuid4())。并且还创建了一个常量文件名:MY_FILE = '{file_uuid}_file.csv'.format(file_uuid=FILE_UUID}

Then - Task 1 is a bashOperator that get MY_FILE as part of the command, and it creates a file successfully. I can see the generated files include a specific UUID in the name,

TASK 2 fails is a PythonOperator that get MY_FILE as an op_args. But can't access the file. Logs show that it tries to access files with a different UUID.

Why is my "constant" is being run …

uuid constants airflow

5
推荐指数
1
解决办法
1683
查看次数

标签 统计

airflow ×1

constants ×1

uuid ×1