0

I have:

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)

When I use the Google API Explorer to try out list_companies it successfully returns the companies I have created.

If I try to again call CLIENT.create_company(PROJECT_PATH, company) with the same company dict from my project it successfully throws exceptions.AlreadyExists

Where's the misstep?

Carl
  • 2,896
  • 2
  • 32
  • 50

1 Answers1

1

Have you tried looping over the contents and checking?

for ele in CLIENT.list_companies(PROJECT_PATH):
    print(ele)
Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65
  • I've been doing response = CLIENT.list_companies(... and printing response.num_results which prints as 0. Looping reveals the data! A big thank you! With_results displaying 0 I was totally misdirected. – Carl Jun 17 '19 at 14:49