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

Fix Colab authentication bug #2082

merged 3 commits into from
Jul 17, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jul 17, 2024

This PR fixes the Colab authentication bug that causes duplicate authentication. If a session has already been authenticated and initialized by EE, geemap should skip the authentication.

import ee
import geemap

ee.Authenticate()
ee.Initialize(project="YOUR-PROJECT-ID")
m = geemap.Map()

@giswqs giswqs requested a review from naschmitz July 17, 2024 18:52
Copy link
Collaborator

@naschmitz naschmitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're early-returning out of this function. We need to set the user agent at the top of the function instead of at the end.

@giswqs
Copy link
Member Author

giswqs commented Jul 17, 2024

@naschmitz Does ee.data.setUserAgent(user_agent) work before authentication and initialization? If yes, we can move it to the top.

Copy link

github-actions bot commented Jul 17, 2024

@giswqs
Copy link
Member Author

giswqs commented Jul 17, 2024

Tested on Colab. Setting user agent does not seems to required authentication.

image

@github-actions github-actions bot temporarily deployed to pull request July 17, 2024 19:07 Inactive
@giswqs giswqs merged commit 403ec76 into master Jul 17, 2024
14 checks passed
@giswqs giswqs deleted the colab branch July 17, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants