Skip to content

Google Cloud AI Platform Optimizer API is completely broken when constructed using discovery.build("ml", "v1") #1470

Open
@Ark-kun

Description

@Ark-kun

Thanks for stopping by to let us know something could be better!

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version: Linux
  • google-api-python-client version: pip show google-api-python-client

Code example

from googleapiclient import discovery
ml_v1 = discovery.build("ml", "v1")
ml_v1.projects().locations().studies().list(parent='projects/<my-project>/locations/us-central1').execute()

Stack trace

---------------------------------------------------------------------------
HttpError                                 Traceback (most recent call last)
<ipython-input-7-35c4fabe04d6> in <module>
----> 1 ml_v1_projects_locations_studies.list(parent='projects/140626129697/locations/us-central1').execute()

/opt/conda/lib/python3.7/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs)
    129                 elif positional_parameters_enforcement == POSITIONAL_WARNING:
    130                     logger.warning(message)
--> 131             return wrapped(*args, **kwargs)
    132 
    133         return positional_wrapper

/opt/conda/lib/python3.7/site-packages/googleapiclient/http.py in execute(self, http, num_retries)
    935             callback(resp)
    936         if resp.status >= 300:
--> 937             raise HttpError(resp, content, uri=self.uri)
    938         return self.postproc(resp, content)
    939 

HttpError: <HttpError 501 when requesting https://ml.googleapis.com/v1/projects/140626129697/locations/us-central1/studies?alt=json returned "Operation is not implemented, or supported, or enabled.". Details: "Operation is not implemented, or supported, or enabled.">

The main issue is that baseUrl is "https://ml.googleapis.com/" instead of "https://us-central1-ml.googleapis.com/".

The https://us-central1-ml.googleapis.com/$discovery/rest?version=v1 discovery doc has this problem as well.

Can you please fix this or send it to the relevant Google teams, so that they fix their discovery docs.

Metadata

Metadata

Assignees

Labels

externalThis issue is blocked on a bug with the actual product.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions