BigQuery v0.28 ChunkedEncodingError :('连接断开:IncompleteRead(读取46个字节)',IncompleteRead(读取46个字节))

问题描述 投票:0回答:1

我正在尝试将我们的BigQuery客户端库迁移到版本0.28。现在当我试图得到一个表引用时,它失败了ChunkedEncodingError。这是我的代码:

def table_exists(client, table_reference):
    from google.cloud.exceptions import NotFound

    try:
        client.get_table(table_reference)
        return True
    except NotFound:
        return False

我们正在使用GAE标准环境。这可能是请求库的问题吗?

google-app-engine google-bigquery
1个回答
2
投票

当使用ChunkedEncodingError包和部署的App Engine Standard with Python时,我得到了相同的google-cloud-bigquery错误。

这是使用Google App Engine的urllib3的问题。正如你在this link中看到的:

...如果您正在使用标准环境,那么您必须使用urllib3.contrib.appengine的AppEngineManager或使用套接字API

我使用了套接字API,它包括将以下内容添加到app.yaml文件中:

env_variables:
  GAE_USE_SOCKETS_HTTPLIB : 'true'

你有official google Sockets Python API docs here

之后,您可以重新部署,它应该工作。

还有google-cloud-bigquery(0.30.0)的最新版本,如果你不断出现错误,请尝试使用0.28.0而不是0.28.0。

© www.soinside.com 2019 - 2024. All rights reserved.