使用气流发送 csv
Send csv with airflow
您好,我正在尝试发送一个存储在 gcp 存储中的带有 airflow (composer) csv 的文件,但我无法附加它。
我收到错误消息“没有这样的文件或目录:'gs://bucket-test/test.csv'”
如果我没有附加文件,邮件发送正确。
另一个问题是:我可以创建一个 csv 文件而不将其保存到存储吗?并直接发送
output_file = 'gs://bucket-test/test.csv'
email_summary = email_operator.EmailOperator(
task_id='email_summary',
to=['test@gmail.com'],
subject='Sample email',
html_content="""
test_01.
""",
files=[output_file])
airflow无法直接访问存储桶,所以必须先将文件下载到本地文件系统
download_file = GCSToLocalFilesystemOperator(
task_id="download_file",
object_name='test.csv',
bucket='bucket-test',
filename='/home/airflow/gcs/data/test.csv',
)
您好,我正在尝试发送一个存储在 gcp 存储中的带有 airflow (composer) csv 的文件,但我无法附加它。 我收到错误消息“没有这样的文件或目录:'gs://bucket-test/test.csv'”
如果我没有附加文件,邮件发送正确。
另一个问题是:我可以创建一个 csv 文件而不将其保存到存储吗?并直接发送
output_file = 'gs://bucket-test/test.csv'
email_summary = email_operator.EmailOperator(
task_id='email_summary',
to=['test@gmail.com'],
subject='Sample email',
html_content="""
test_01.
""",
files=[output_file])
airflow无法直接访问存储桶,所以必须先将文件下载到本地文件系统
download_file = GCSToLocalFilesystemOperator(
task_id="download_file",
object_name='test.csv',
bucket='bucket-test',
filename='/home/airflow/gcs/data/test.csv',
)