From: Brett Smith Date: Fri, 1 Dec 2023 15:18:13 +0000 (-0500) Subject: 21146: Add last_log_id argument to PollClient.subscribe X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/refs/heads/21146-pysdk-new-websockets 21146: Add last_log_id argument to PollClient.subscribe This helps avoid a crash if `subscribe` returns a `PollClient` and then the user calls `subscribe` with two arguments. I don't know whether ignoring `last_log_id` is *correct*, but that's the current behavior, and anything else is out of scope for the current ticket. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- diff --git a/sdk/python/arvados/events.py b/sdk/python/arvados/events.py index 56650558e8..917c876706 100644 --- a/sdk/python/arvados/events.py +++ b/sdk/python/arvados/events.py @@ -468,12 +468,15 @@ class PollClient(threading.Thread): # to do so raises the same exception." pass - def subscribe(self, f: Filter) -> None: + def subscribe(self, f: Filter, last_log_id: Optional[int]=None) -> None: """Subscribe to another set of events from the server Arguments: * f: arvados.events.Filter | None --- One filter to subscribe to. + + * last_log_id: Optional[int] --- Ignored; this argument exists for + API compatibility with `EventClient.subscribe`. """ self.on_event({'status': 200}) self.filters.append(f)