[energidataservice] Reduce redundant persistence of tariffs #16222
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.
Unlike spotprices, tariffs are not updated by the hour.
The most dynamic tariff is the grid tariff which can currently change as often as four times per day. The most static one is the system tariff which is usually only changed once in very hectic years.
The time series implementation didn't take any of this into consideration. Previously when using persistence strategy everyChange this was not a problem (first row is an actual change, the rest are probably caused by restarts):
Now, when using persistence strategy forecast, this would cause many redundant updates:
This fix will avoid adding such redundant updates to the published time series.
As an example, for N1 grid tariffs the red marked rows will no longer be persisted: