我正在尝试使用
google translate
python 存储过程调用 snowflake
python 代码。调用该函数时,我收到错误如下
File "/home/udf/83428393/httpcore.zip/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 16] Device or resource busy
上述异常是导致以下异常的直接原因:
Traceback (most recent call last):
File "/usr/lib/python_udf/f8ec62c410e9e3922c786641658c8c13d2fb99db0751b02297123925d6bd4997/lib/python3.10/site-packages/httpx/_transports/default.py", line 84, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 16] Device or resource busy
我正在使用
httpx 0.26.1
版本。请推荐。
我相信您需要在 Snowflake 中创建外部访问集成。 请参阅Snowflake 文档中的所有详细信息。
本质上:
CREATE OR REPLACE SECRET oauth_token
TYPE = OAUTH2
API_AUTHENTICATION = google_translate_oauth
OAUTH_REFRESH_TOKEN = 'my-refresh-token';
CREATE OR REPLACE NETWORK RULE google_apis_network_rule
MODE = EGRESS
TYPE = HOST_PORT
VALUE_LIST = ('translation.googleapis.com');
USE ROLE ACCOUNTADMIN;
CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION google_apis_access_integration
ALLOWED_NETWORK_RULES = (google_apis_network_rule)
ALLOWED_AUTHENTICATION_SECRETS = (oauth_token)
ENABLED = true;
EXTERNAL_ACCESS_INTEGRATIONS = (google_apis_access_integration)
和 SECRETS = ('cred' = oauth_token )