Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Colab authentication bug #2082

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading