From 3074b6b8c1f404b83b3e499ca32789bda6295eff Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Thu, 17 Oct 2024 16:50:56 +0200 Subject: [PATCH 1/2] Add YEARLY frequency Signed-off-by: Mathias L. Baumann --- RELEASE_NOTES.md | 16 +--------------- src/frequenz/client/dispatch/types.py | 1 + 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1302ad9..6ebf439 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,19 +1,5 @@ # Frequenz Dispatch Client Library Release Notes -## Summary - - - -## Upgrading - -* `Client.stream()` will now raise an Exception when the connection is lost. -* `Client.create()` and `Client.list() now take all optional arguments as keyword-only arguments. - -## New Features - -* Added support for duration=None when creating a dispatch. -* The `FakeService` now supports the `stream()` method. - ## Bug Fixes - +* Fix crash by adding the missing YEARLY frequency. diff --git a/src/frequenz/client/dispatch/types.py b/src/frequenz/client/dispatch/types.py index c9ab30d..e19976c 100644 --- a/src/frequenz/client/dispatch/types.py +++ b/src/frequenz/client/dispatch/types.py @@ -116,6 +116,7 @@ class Frequency(IntEnum): DAILY = PBRecurrenceRule.FREQUENCY_DAILY WEEKLY = PBRecurrenceRule.FREQUENCY_WEEKLY MONTHLY = PBRecurrenceRule.FREQUENCY_MONTHLY + YEARLY = PBRecurrenceRule.FREQUENCY_YEARLY @dataclass(kw_only=True) From fdb6bdef29e68e3d1effdc061fad2baf0f8cbf87 Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Thu, 17 Oct 2024 16:55:50 +0200 Subject: [PATCH 2/2] Fix page_size=None case Signed-off-by: Mathias L. Baumann --- src/frequenz/client/dispatch/_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frequenz/client/dispatch/_client.py b/src/frequenz/client/dispatch/_client.py index 8af510d..1fbd69e 100644 --- a/src/frequenz/client/dispatch/_client.py +++ b/src/frequenz/client/dispatch/_client.py @@ -162,7 +162,9 @@ def to_interval( request = ListMicrogridDispatchesRequest( microgrid_id=microgrid_id, filter=filters, - pagination_params=PaginationParams(page_size=page_size), + pagination_params=( + PaginationParams(page_size=page_size) if page_size else None + ), ) while True: