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

why using http_transport in ee.Initialize function? #914

Closed
dfguerrerom opened this issue May 5, 2024 · 3 comments
Closed

why using http_transport in ee.Initialize function? #914

dfguerrerom opened this issue May 5, 2024 · 3 comments

Comments

@dfguerrerom
Copy link
Collaborator

I started to see this problem in one of the apps I'm developing and in which I want to use a ThreadPoolExecutor to improve the loading speed of some GEE requests.
I managed to create an small reproducible example:

import ee
import concurrent.futures
import httplib2

ee.Initialize(http_transport=httplib2.Http())


def task_function():
    print(ee.Number(1e13).getInfo())

with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
    
    future_tasks = [executor.submit(task_function) for _ in range(100)]
    
    # Wait for all tasks to complete and get their results
    for future in concurrent.futures.as_completed(future_tasks):
        try:
            result = future.result()
            # Process result here
        except Exception as exc:
            print(f'Generated an exception: {exc}')

The kernel will crash if I use ee.Initialize(http_transport=httplib2.Http()), however, if I remove the http_transport protocol, it works... I'm not sure why that arg was used, is there any reason for that?

@12rambau
Copy link
Member

12rambau commented May 7, 2024

that args was used a long time ago because of a bug in GEE api. It might not be needed anymore. Can you make a PR removing it to check if the tests are happy ?

@dfguerrerom
Copy link
Collaborator Author

but until we don't fix #905, we cannot advance with the tests.

that args was used a long time ago because of a bug in GEE api. It might not be needed anymore. Can you make a PR removing it to check if the tests are happy ?

@dfguerrerom
Copy link
Collaborator Author

this was fixed with f183455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants