为什么 list_companies() 不返回我在 Google 云人才解决方案中创建的公司?



我有:

from google.cloud import talent_v4beta1
CLIENT = talent_v4beta1.CompanyServiceClient()
PROJECT_ID = '...'
PROJECT_PATH = 'projects/{}'.format(PROJECT_ID)
company = {
    'display_name' : ...,
    'external_id' : ...
}
# this call successful creates a new company
CLIENT.create_company(PROJECT_PATH, company)
# this call doesn't return any companies
CLIENT.list_companies(PROJECT_PATH)

当我使用Google API资源管理器进行尝试时list_companies它成功地返回了我创建的公司。

如果我尝试再次使用项目中的相同company字典调用CLIENT.create_company(PROJECT_PATH, company),它会成功抛出exceptions.AlreadyExists

失策在哪里?

您是否尝试过循环访问内容并进行检查?

for ele in CLIENT.list_companies(PROJECT_PATH):
    print(ele)

相关内容

最新更新