googleapis / googleapis/python-aiplatform

Inconsistent GOOGLE_CLOUD_PROJECT env variable

Abierto
#5,392 0 comentarios 0 reacciones 0 asignados Ver en GitHub
api: vertex-ai
Lenguaje dominante
Python
Estrellas
905
Forks
465
Merge medio
1 d 13 h
PR fusionados (30 d)
44

Descripción

Currently in the [google/cloud/aiplatform/initializer.py#L92](https://github.com/googleapis/python-aiplatform/blob/c81eb7219631e58c6002a7aff8905545bda1132a/google/cloud/aiplatform/initializer.py#L92) we expect GOOGLE_CLOUD_PROJECT variable to be set to project number (and we try to convert it to project Id further).

But [google.auth.default()](https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/_default.py) we rely on everywhere actually expects GOOGLE_CLOUD_PROJECT to be set to project Id already.

So having that env variable set gives wrong values for [project property](https://github.com/googleapis/python-aiplatform/blob/c81eb7219631e58c6002a7aff8905545bda1132a/google/cloud/aiplatform/initializer.py#L350) from initialized context.

This can probably have side effects on the code dependent on this library, but we can either introduce another env variable for project number, or remove the [code trying to convert it to project Id](https://github.com/googleapis/python-aiplatform/blob/c81eb7219631e58c6002a7aff8905545bda1132a/google/cloud/aiplatform/initializer.py#L101).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.