Repository navigation
EPEX Predictor: mark predicted prices as estimate - #36358
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="templates/definition/tariff/epex-predictor.yaml" line_range="41" />
<code_context>
"end": (.startsAt | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime + 900 | strftime("%Y-%m-%dT%H:%M:%SZ")),
- "value": .total
+ "value": .total,
+ "estimate": (.startsAt > $known)
}] | tostring
</code_context>
<issue_to_address>
**Final prices shown as estimates**
When a self-hosted or older API response omits `knownUntil`, `$known` is null and jq's type ordering makes every string `.startsAt > null` true, so every slot is marked as an estimate and finalized prices are shown as predictions.
Guard the comparison so slots are marked as estimates only when `knownUntil` is present.
</issue_to_address>| "end": (.startsAt | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime + 900 | strftime("%Y-%m-%dT%H:%M:%SZ")), | ||
| "value": .total | ||
| "value": .total, | ||
| "estimate": (.startsAt > $known) |
Contributor
There was a problem hiding this comment.
🟡 Medium · Final prices shown as estimates
When a self-hosted or older API response omits knownUntil, $known is null and jq's type ordering makes every string .startsAt > null true, so every slot is marked as an estimate and finalized prices are shown as predictions.
Guard the comparison so slots are marked as estimates only when knownUntil is present.
Prompt for AI agents
In `templates/definition/tariff/epex-predictor.yaml` at line 41:
**Final prices shown as estimates**
When a self-hosted or older API response omits `knownUntil`, `$known` is null and jq's type ordering makes every string `.startsAt > null` true, so every slot is marked as an estimate and finalized prices are shown as predictions.
Guard the comparison so slots are marked as estimates only when `knownUntil` is present.
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.
Follow-up for #36138. The API returns a top-level
knownUntilwith the start of the last published EPEX slot; every slot after it is a prediction. The template mapsstartsAt > knownUntiltoestimate: true. One-line change, no API changes needed.Checked live for DE: the last known slot starts
22:45Z, the first estimate starts23:00Z.🤖 Generated with Claude Code