googleapis / googleapis/python-aiplatform

Inconsistent GOOGLE_CLOUD_PROJECT env variable

Ouverte
#5,392 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
api: vertex-ai
Langage dominant
Python
Étoiles
905
Forks
465
Merge moyen
1 j 13 h
PR mergées (30 j)
44

Description

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).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.