Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
156 stars 42 forks source link

Pylance type check is not working #542

Closed hoetmaaiers closed 9 months ago

hoetmaaiers commented 9 months ago

The load_connection function in VSCode returns me the types of the decorator. This can be solved by changing the type signature of the openeo_process.

Changing the current implementation https://github.com/Open-EO/openeo-python-client/blob/master/openeo/internal/documentation.py#L14

to this solves that problem:

T = TypeVar('T')

def openeo_process(f: Optional[T] = None, process_id: Optional[str] = None, mode: Optional[str] = None) -> T:

Does this make sense to the OpenEO contributors? Is a PR a good idea for this?

@hghcomphys helped me figuring out this problem 🙏

soxofaan commented 9 months ago

Sure, if this is something that improves the developer experience, we would be certainly open to something like this.

soxofaan commented 9 months ago

done with #543 thanks!