Skip to content

Commit

Permalink
Defaulted to project id from credentials file.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdanielw committed Dec 20, 2023
1 parent 2ed8de3 commit dc1290b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit dc1290b

Please sign in to comment.