From dc1290b251f7064a778a7fb367d2f08c45586ddb Mon Sep 17 00:00:00 2001 From: Daniel Wiell Date: Wed, 20 Dec 2023 11:31:34 +0000 Subject: [PATCH] Defaulted to project id from credentials file. --- python/ee/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/ee/__init__.py b/python/ee/__init__.py index b61d9bcf8..0dc884b60 100644 --- a/python/ee/__init__.py +++ b/python/ee/__init__.py @@ -9,6 +9,7 @@ import collections import datetime import inspect +import json import os from typing import Any, Hashable, List as ListType, Optional, Sequence, Tuple, Type, Union @@ -137,6 +138,9 @@ def Initialize( if credentials == 'persistent': credentials = data.get_persistent_credentials() + if not project: + project = json.load(open(oauth.get_credentials_path())).get('project_id') + data.initialize( credentials=credentials, api_base_url=(url + '/api' if url else None),