Expose OpenEO-Identifier header from sync processing response#893
Expose OpenEO-Identifier header from sync processing response#893Copilot wants to merge 3 commits into
Conversation
…og OpenEO-Identifier Agent-Logs-Url: https://github.com/Open-EO/openeo-python-client/sessions/72ac5e9e-be54-4fc5-acef-10648287ee35 Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
| validate: Optional[bool] = None, | ||
| auto_decode: bool = True, | ||
| on_response_headers: Optional[Callable[[Mapping], None]] = None, | ||
| ) -> Union[dict, requests.Response]: |
There was a problem hiding this comment.
I don't think that is necessary in this PR
|
|
||
| def execute(self, *, validate: Optional[bool] = None) -> dict: | ||
| def execute(self, *, validate: Optional[bool] = None, on_response_headers: Optional[Callable[[Mapping], None]] = None) -> dict: | ||
| """Executes the process graph.""" |
There was a problem hiding this comment.
I don't think this is necessary in this PR
| """Test that on_response_headers callback is called with response headers from execute.""" | ||
| dummy_backend.next_result = {"result": 42} | ||
| results = [] | ||
| s2cube.execute(on_response_headers=results.append) |
There was a problem hiding this comment.
This does not test the added feature
| """Test that on_response_headers callback is called with response headers from VectorCube.execute.""" | ||
| results = [] | ||
| vector_cube.execute(on_response_headers=results.append) | ||
| assert results == [{"OpenEO-Identifier": "r-001"}] |
There was a problem hiding this comment.
this is not a test for the added feature
| {"foo1": {"process_id": "foo"}}, | ||
| on_response_headers=results.append, | ||
| ) | ||
| assert results == [{"OpenEO-Identifier": "r-001"}] |
There was a problem hiding this comment.
this is not a test for the added feature
| dummy_backend.next_result = {"result": 42} | ||
| connection = openeo.connect(dummy_backend.connection.root_url, on_response_headers_sync=results.append) | ||
| connection.execute({"foo1": {"process_id": "foo"}}) | ||
| assert results == [{"OpenEO-Identifier": "r-001"}] |
There was a problem hiding this comment.
this is not a test for the added feature
|
|
||
|
|
||
| def test_download_openeo_identifier_logging(dummy_backend, tmp_path, caplog): | ||
| import logging |
There was a problem hiding this comment.
Fixed in fb8646f — logging is already imported at the top of the file, so the local import was removed.
|
|
||
|
|
||
| def test_execute_openeo_identifier_logging(dummy_backend, caplog): | ||
| import logging |
…ve related tests, fix local imports Agent-Logs-Url: https://github.com/Open-EO/openeo-python-client/sessions/a5d2dc5a-87ff-4776-8246-7f2a8e337784 Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
overruled by 14cc3d7 |
OpenEO API v1.3 added an
OpenEO-Identifierresponse header toPOST /resultto expose a tracking identifier for synchronous processing requests. This PR wires that header through to callers.Changes
Connection.download()/Connection.execute(): Automatically log theOpenEO-IdentifieratDEBUGlevel when present — no extra code required to see it in logsUsage