Skip to content

Expose OpenEO-Identifier header from sync processing response#893

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/expose-openeo-identifier-header
Closed

Expose OpenEO-Identifier header from sync processing response#893
Copilot wants to merge 3 commits into
masterfrom
copilot/expose-openeo-identifier-header

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

OpenEO API v1.3 added an OpenEO-Identifier response header to POST /result to expose a tracking identifier for synchronous processing requests. This PR wires that header through to callers.

Changes

  • Connection.download() / Connection.execute(): Automatically log the OpenEO-Identifier at DEBUG level when present — no extra code required to see it in logs
  • Tests added for the new auto-logging behaviour; CHANGELOG updated

Usage

# Enable DEBUG logging — identifier is logged automatically with no extra code
import logging
logging.basicConfig(level=logging.DEBUG)

connection.download(...)   # logs "Synchronous processing request identifier: r-001"
connection.execute(...)    # same

Copilot AI changed the title [WIP] Add OpenEO-Identifier header from sync response Expose OpenEO-Identifier header from sync processing response Apr 28, 2026
Copilot AI requested a review from soxofaan April 28, 2026 06:21
Comment thread openeo/rest/datacube.py Outdated
validate: Optional[bool] = None,
auto_decode: bool = True,
on_response_headers: Optional[Callable[[Mapping], None]] = None,
) -> Union[dict, requests.Response]:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that is necessary in this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted in fb8646f.

Comment thread openeo/rest/vectorcube.py

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."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is necessary in this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted in fb8646f.

Comment thread tests/rest/datacube/test_datacube100.py Outdated
"""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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not test the added feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in fb8646f.

Comment thread tests/rest/datacube/test_vectorcube.py Outdated
"""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"}]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is not a test for the added feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in fb8646f.

Comment thread tests/rest/test_connection.py Outdated
{"foo1": {"process_id": "foo"}},
on_response_headers=results.append,
)
assert results == [{"OpenEO-Identifier": "r-001"}]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is not a test for the added feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in fb8646f.

Comment thread tests/rest/test_connection.py Outdated
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"}]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is not a test for the added feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in fb8646f.

Comment thread tests/rest/test_connection.py Outdated


def test_download_openeo_identifier_logging(dummy_backend, tmp_path, caplog):
import logging
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

avoid this local import

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fb8646flogging is already imported at the top of the file, so the local import was removed.

Comment thread tests/rest/test_connection.py Outdated


def test_execute_openeo_identifier_logging(dummy_backend, caplog):
import logging
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

avoid this local import

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fb8646f.

…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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 28, 2026

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:

  • oeo.test
    • Triggering command: /usr/bin/python python -m pytest tests/rest/ -x -q (dns block)
  • provider.test
    • Triggering command: /usr/bin/python python -m pytest tests/rest/ -x -q (dns block)
  • stac.test
    • Triggering command: /usr/bin/python python -m pytest tests/rest/ -x -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from soxofaan April 28, 2026 09:41
@soxofaan
Copy link
Copy Markdown
Member

overruled by 14cc3d7

@soxofaan soxofaan closed this Apr 29, 2026
@soxofaan soxofaan deleted the copilot/expose-openeo-identifier-header branch April 29, 2026 07:37
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.

expose OpenEO-Identifier header from sync response

2 participants