_JobResultDownloader: support "auto_increment" var in path templates - #936
Open
soxofaan wants to merge 1 commit into
Open
_JobResultDownloader: support "auto_increment" var in path templates#936soxofaan wants to merge 1 commit into
soxofaan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an auto_increment template variable to _JobResultDownloader path templates to generate deterministic, sequential filenames when downloading job results as a self-contained STAC collection (useful when backend-provided names are unstable or inconsistent).
Changes:
- Add per-entity-type auto-increment counters and expose
{auto_increment}in collection/item/asset/generic-link path template rendering. - Add a regression test covering
{auto_increment}formatting (including numeric format specs like:02d/:03d) and link rewriting behavior. - Bump package version to
0.52.0a5.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
openeo/rest/job.py |
Introduces auto-increment counters and wires {auto_increment} into path building for collection/items/assets/generic links. |
tests/rest/test_job.py |
Adds test coverage validating deterministic filenames and rewritten hrefs using {auto_increment} templates. |
openeo/_version.py |
Bumps the package version to the next alpha. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
835
to
+840
| def build_path_collection(self, *, collection_id: str) -> Path: | ||
| """Build path for the root STAC collection metadata file (job results metadata)""" | ||
| vars = { | ||
| "job_id": _sanitize_filename(self._job.job_id), | ||
| "collection_id": _sanitize_filename(collection_id), | ||
| "auto_increment": self._auto_increment_id("collection"), |
| @@ -1 +1 @@ | |||
| __version__ = "0.52.0a4" | |||
| __version__ = "0.52.0a5" | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add "auto_increment" variable to build stable download filenames, regardless of backend naming approach (e.g. when UUID based naming is in play)
related to #931, eu-cdse/openeo-cdse-infra#1259