python - 构建没有文件但直接解析凭据的 bigquery 客户端
问题描述
我正在尝试使用 google-cloud-bigquery 包。
当我想创建一个Client
文件时,我可以指向一个文件的路径,例如
from google.cloud import bigquery
client = bigquery.Client.from_service_account_json("path/to/credentials/cred.json")
根据文档,我应该能够直接使用解析凭据
from google.cloud import bigquery
creds = get_creds_as_string() #Returns the credentials as a string
client = bigquery.Client.from_service_account_info(creds)
但这引发了
type object 'Client' has no attribute 'from_service_account_info'
这很奇怪,因为该方法在文档中进行了描述。
有没有办法直接解析凭据?
解决方案
推荐阅读
- security - 实施 ISO 27001
- regex - 如何编写匹配所有不包含任何控制字符的字符的正则表达式?
- html - 容器 xxl 不适用于 Angular 的引导程序 5
- arrays - 为什么String Array在JSP中会抛出错误
- r - survminer 中的风险表不绘图?RCPP 错误
- ruby-on-rails - rails:回形针 gem 的迁移问题
- jdbc - 使用包括用户和密码的连接字符串时通过 JDBC 连接到 DB2 错误
- reactjs - 从 useContext + useReducer 迁移到 Redux
- r - 使用类合并函数替换行中的 NA
- javascript - Cypress 测试,一个测试结束,第二个开始