diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d16a3351..bc7c14c6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,7 @@ ## Upgrading - The `Dispatch` class is now a frozen dataclass, meaning that it is immutable. Modifications can still be done using `replace`: `dispatch = replace(dispatch, start_time=new_start_time)`. +- The `Client.update()` method now requires named parameters. ## New Features diff --git a/src/frequenz/client/dispatch/_client.py b/src/frequenz/client/dispatch/_client.py index 18d8cef1..6758a5a6 100644 --- a/src/frequenz/client/dispatch/_client.py +++ b/src/frequenz/client/dispatch/_client.py @@ -166,6 +166,7 @@ async def create( async def update( self, + *, dispatch_id: int, new_fields: dict[str, Any], ) -> None: diff --git a/tests/test_dispatch_client.py b/tests/test_dispatch_client.py index 2b6e6849..845b0325 100644 --- a/tests/test_dispatch_client.py +++ b/tests/test_dispatch_client.py @@ -99,7 +99,7 @@ async def test_update_dispatch() -> None: sample = _update(sample, dispatch) assert dispatch == sample - await client.update(dispatch.id, {"recurrence.interval": 4}) + await client.update(dispatch_id=dispatch.id, new_fields={"recurrence.interval": 4}) assert client.dispatches[0].recurrence.interval == 4