-1

我正在学习使用 TensorFlow 扩展构建机器学习管道,我按照教程进行操作,现在我喜欢构建自己的。直接从 BigQuery 提取数据时出现错误。请提前告知和感谢!

代码:

from tfx.components.example_gen.big_query_example_gen.component import BigQueryExampleGen

query = """
    SELECT * FROM `<project_id>.<database>.<table_name>`
"""
example_gen = BigQueryExampleGen(query=query)

错误:

RuntimeError: Missing executing project information. Please use the --project command line option to specify it.
4

2 回答 2

1

由于即使在我添加了 Google Applicaton Credential 之后也不支持 bigquery 客户端初始化的参数,所以我一直在努力使用 CsvExampleGen。

于 2020-05-06T03:51:57.517 回答
0

我不确定您是否已经解决了它,但是要使用 BigQuery 作为输入,您必须像这样设置 --project-id 标志:

example_gen = components.BigQueryExampleGen(query='SELECT * except(day) FROM `gofind-datalake.data.temp_dist` where rand() < 2800/30713393 limit 3000')
context.run(example_gen, beam_pipeline_args=["--project=gofind-datalake"])
于 2020-05-22T18:15:23.030 回答