googleapis / googleapis/python-aiplatform

Inconsistent GOOGLE_CLOUD_PROJECT env variable

Offen
#5,392 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: vertex-ai
Vorherrschende Sprache
Python
Sterne
905
Forks
465
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
44

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.