Skip to content

Commit

Permalink
Fix Colab authentication bug (#2082)
Browse files Browse the repository at this point in the history
* Fix Colab authentication bug

* Add user agent to Colab

* Set user agent as the top
  • Loading branch information
giswqs authored Jul 17, 2024
1 parent 5a534a7 commit 403ec76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geemap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def ee_initialize(
from .__init__ import __version__

user_agent = f"{user_agent_prefix}/{__version__}"
ee.data.setUserAgent(user_agent)

if "http_transport" not in kwargs:
kwargs["http_transport"] = httplib2.Http()

if auth_mode is None:
if in_colab_shell():
if in_colab_shell() and (ee.data._credentials is None):
from google.colab import userdata

if project is None:
Expand Down Expand Up @@ -154,8 +156,6 @@ def ee_initialize(
ee.Authenticate(**auth_args)
ee.Initialize(**kwargs)

ee.data.setUserAgent(user_agent)


def ee_export_image(
ee_object,
Expand Down

0 comments on commit 403ec76

Please sign in to comment.