Skip to content

why using http_transport in ee.Initialize function? #914

@dfguerrerom

Description

@dfguerrerom

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions