Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport resampler log enhancement to v0.25.x #928

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

<!-- Here goes the main new features and examples or instructions on how to use them -->

## Enhancements

- A warning message will now be logged if no relevant samples are found in a component for resampling.

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
2 changes: 2 additions & 0 deletions src/frequenz/sdk/timeseries/_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ def resample(self, timestamp: datetime) -> Sample[Quantity]:
# So if we need more performance beyond this point, we probably need to
# resort to some C (or similar) implementation.
relevant_samples = list(itertools.islice(self._buffer, min_index, max_index))
if not relevant_samples:
_logger.warning("No relevant samples found for component: %s", self._name)
value = (
conf.resampling_function(relevant_samples, conf, props)
if relevant_samples
Expand Down
Loading