From 716d3f1a028cbe898b07608bff1bfee71ba7bffe Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 14 May 2023 14:22:37 +0000 Subject: [PATCH] Stop trying to use kwargs with get_recent_changes. --- matcher/wikidata_api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/matcher/wikidata_api.py b/matcher/wikidata_api.py index 5815cbf..b9a19d1 100644 --- a/matcher/wikidata_api.py +++ b/matcher/wikidata_api.py @@ -38,7 +38,9 @@ def get_revision_timestamp(revid: int) -> str: return cast(str, rev["timestamp"]) -def get_recent_changes(**kwargs: CallParams) -> requests.Response: +def get_recent_changes( + rcstart: str | None = None, rccontinue: str | None = None +) -> requests.Response: """Get list of recent changes.""" props = [ "title", @@ -54,14 +56,14 @@ def get_recent_changes(**kwargs: CallParams) -> requests.Response: "action": "query", "list": "recentchanges", "rcnamespace": 0, - # "rctype": "log", - # "rclimit": "max", "rclimit": "max", - # "rcstart": start, "rcdir": "newer", "rcprop": "|".join(props), - **{k: cast(str | int, v) for k, v in kwargs.items() if v}, } + if rcstart is not None: + params["rcstart"] = rcstart + if rccontinue is not None: + params["rccontinue"] = rccontinue return api_get(params)