nla*_*aux 7

您现在可以写入文本并使用文本接收器指定标题。

从文档:

class apache_beam.io.textio.WriteToText(file_path_prefix, file_name_suffix='', append_trailing_newlines=True, num_shards=0, shard_name_template=None, coder=ToStringCoder, compression_type='auto', header=None)
Run Code Online (Sandbox Code Playgroud)

因此,您可以使用以下代码:

beam.io.WriteToText(bucket_name, file_name_suffix='.csv', header='colname1, colname2')
Run Code Online (Sandbox Code Playgroud)

如果您需要详细信息或检查它的实现方式,可以在此处获得完整的文档:https : //beam.apache.org/documentation/sdks/pydoc/2.0.0/_modules/apache_beam/io/textio.html#WriteToText