Skip to content

Commit fc74e8f

Browse files
authored
Disable warn on overflow in config channel receivers (#1152)
2 parents 98fec4b + 19c0dbd commit fc74e8f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies = [
3030
# changing the version
3131
# (plugins.mkdocstrings.handlers.python.import)
3232
"frequenz-client-microgrid >= 0.6.0, < 0.7.0",
33-
"frequenz-channels >= 1.4.0, < 2.0.0",
33+
"frequenz-channels >= 1.6.0, < 2.0.0",
3434
"frequenz-quantities[marshmallow] >= 1.0.0, < 2.0.0",
3535
"networkx >= 2.8, < 4",
3636
"numpy >= 1.26.4, < 2",
@@ -48,7 +48,7 @@ email = "[email protected]"
4848
dev-flake8 = [
4949
"flake8 == 7.1.1",
5050
"flake8-docstrings == 1.7.0",
51-
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
51+
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
5252
"pydoclint == 0.5.14",
5353
"pydocstyle == 6.3.0",
5454
]

src/frequenz/sdk/config/_manager.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ def new_receiver( # pylint: disable=too-many-arguments
227227
"""
228228
_validate_load_kwargs(marshmallow_load_kwargs)
229229

230-
receiver = self.config_channel.new_receiver(name=f"{self}:{key}", limit=1).map(
230+
# We disable warning on overflow, because we are only interested in the latest
231+
# configuration, it is completely fine to drop old configuration updates.
232+
receiver = self.config_channel.new_receiver(
233+
name=f"{self}:{key}", limit=1, warn_on_overflow=False
234+
).map(
231235
lambda config: _load_config_with_logging_and_errors(
232236
config,
233237
config_class,

src/frequenz/sdk/microgrid/_data_pipeline.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from .._internal._channels import ChannelRegistry
2323
from ..actor._actor import Actor
2424
from ..timeseries import ResamplerConfig
25-
from ..timeseries._grid_frequency import GridFrequency
2625
from ..timeseries._voltage_streamer import VoltageStreamer
2726
from ..timeseries.grid import Grid
2827
from ..timeseries.grid import get as get_grid
@@ -35,6 +34,7 @@
3534
#
3635
# pylint: disable=import-outside-toplevel
3736
if typing.TYPE_CHECKING:
37+
from ..timeseries._grid_frequency import GridFrequency
3838
from ..timeseries.battery_pool import BatteryPool
3939
from ..timeseries.battery_pool._battery_pool_reference_store import (
4040
BatteryPoolReferenceStore,
@@ -140,6 +140,8 @@ def __init__(
140140

141141
def frequency(self) -> GridFrequency:
142142
"""Return the grid frequency measuring point."""
143+
from ..timeseries._grid_frequency import GridFrequency
144+
143145
if self._frequency_instance is None:
144146
self._frequency_instance = GridFrequency(
145147
self._data_sourcing_request_sender(),

0 commit comments

Comments
 (0)