Pandas read_gbq 使用 Dataflow 时出现初始化错误
Pandas read_gbq init error using Dataflow
我一直在 运行使用 Python 执行数据流作业,该作业利用了 pandas 库。它突然开始失败并出现以下错误:
File "/usr/local/lib/python2.7/dist-packages/pandas_gbq/auth.py", line 305, in _try_credentials
client = bigquery.Client(project=project_id, credentials=credentials)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/client.py", line 161, in init
self._connection = Connection(self, client_info=client_info)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/_http.py", line 33, in init
super(Connection, self).init(client, client_info)
TypeError: init() takes exactly 2 arguments (3 given)
这一步失败了:
import pandas as pd
data = pd.read_gbq(query=query, project_id=project, dialect='standard', private_key=credentials)
我的安装文件如下所示:
install_requires=[
'google-cloud-storage==1.11.0',
'requests==2.19.1',
'urllib3==1.23',
'pandas-gbq==0.6.1',
'pandas==0.23.4',
'protobuf==3.6.0'
]
这与我本地的版本相同,代码可以正常运行。
当它开始失败时,没有对作业实施任何更改。它 运行 在本地成功,但是当我 运行 使用数据流 运行 时我看到了问题。我认为这是一个依赖性问题。我正在使用的任何软件包版本是否存在记录在案的问题?或者我需要将特定的软件包版本添加到我的安装文件中吗?
我必须将 BigQuery 版本添加到我的安装文件中。
'google-cloud-bigquery==1.6.0'
根据 Google documentation Python SDK 2.5,Dataflow worker 已经安装了 BigQuery 0.25.0。因为我之前没有指定版本,所以我假设这就是我的工作 运行。如果那个版本的 BigQuery 有问题,我仍然不确定为什么这个错误最近才开始发生。无论如何,指定 1.6.0 解决了问题。
我一直在 运行使用 Python 执行数据流作业,该作业利用了 pandas 库。它突然开始失败并出现以下错误:
File "/usr/local/lib/python2.7/dist-packages/pandas_gbq/auth.py", line 305, in _try_credentials client = bigquery.Client(project=project_id, credentials=credentials)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/client.py", line 161, in init self._connection = Connection(self, client_info=client_info)
File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/_http.py", line 33, in init super(Connection, self).init(client, client_info)
TypeError: init() takes exactly 2 arguments (3 given)
这一步失败了:
import pandas as pd
data = pd.read_gbq(query=query, project_id=project, dialect='standard', private_key=credentials)
我的安装文件如下所示:
install_requires=[
'google-cloud-storage==1.11.0',
'requests==2.19.1',
'urllib3==1.23',
'pandas-gbq==0.6.1',
'pandas==0.23.4',
'protobuf==3.6.0'
]
这与我本地的版本相同,代码可以正常运行。 当它开始失败时,没有对作业实施任何更改。它 运行 在本地成功,但是当我 运行 使用数据流 运行 时我看到了问题。我认为这是一个依赖性问题。我正在使用的任何软件包版本是否存在记录在案的问题?或者我需要将特定的软件包版本添加到我的安装文件中吗?
我必须将 BigQuery 版本添加到我的安装文件中。
'google-cloud-bigquery==1.6.0'
根据 Google documentation Python SDK 2.5,Dataflow worker 已经安装了 BigQuery 0.25.0。因为我之前没有指定版本,所以我假设这就是我的工作 运行。如果那个版本的 BigQuery 有问题,我仍然不确定为什么这个错误最近才开始发生。无论如何,指定 1.6.0 解决了问题。