airflow - 将 XCom 与 BashOperator 一起使用:将多行 sdout 输出推送到其他任务?
问题描述
根据文档,“ ,当 bash 命令完成时,If xcom_push is True
写入的最后一行stdout
也将被推送到XCom 。”
但是,我需要返回一个多行字符串,该字符串是从终端执行的python 脚本产生的。我想随后在EmailOperator中使用这个字符串。
所以我的问题是:是否可以通过xcom_push推送比最后一行更多的内容?理想情况下,它可以任意长。非常感谢您的帮助,谢谢!
编辑:我已经通过使用 PythonOperator 并调用脚本解决了这个问题,但我仍然很好奇是否可以将多行数据从 BashOperator 推送到 XCom
解决方案
推荐阅读
- sql - oracle正则表达式格式化电话号码
- python - 在文本文件中写入整数或布尔值
- api - 基于位置的谷歌搜索历史
- ruby-on-rails - 正确配置 rubycritic 和 reek 以忽略 InstanceVariableAssumption
- python - 递归与迭代函数 Python
- java - 在这个将前缀转换为后缀的程序中,为什么在执行以下代码时会显示运行时错误“ArrayIndexOutOfBound”?
- c - 为什么这个变量等于一个数字和一个字符?
- node.js - 使用 Express 访问静态内容和 API
- mysql - 如何复制表(MySQL)并自动更新新表?
- java - 如何从本地java应用程序连接到kerberized hive