googleapis / googleapis/python-aiplatform
Inconsistent GOOGLE_CLOUD_PROJECT env variable
- 主要言語
- Python
- スター
- 905
- フォーク
- 465
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 44
説明
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).
コントリビューションガイド
評価
この issue はまだ評価されていません。