@@ -48,11 +48,12 @@ def _cache_pagination(self, response: Dict[str, Any], page_key: str) -> None:
4848
4949 def first_page (self ) -> Tuple [List [Any ], Pagination | None ]:
5050 """Fetches the first page of results."""
51- params = self ._params .copy ()
52-
53- params ["on_response" ] = lambda response : self ._cache_pagination (
54- response , self ._FIRST_PAGE
55- )
51+ params = {
52+ ** self ._params ,
53+ "on_response" : lambda response : self ._cache_pagination (
54+ response , self ._FIRST_PAGE
55+ ),
56+ }
5657
5758 data = self ._request (** params )
5859 pagination = self ._pagination_cache .get (self ._FIRST_PAGE )
@@ -62,15 +63,15 @@ def first_page(self) -> Tuple[List[Any], Pagination | None]:
6263 def next_page (self , next_page_cursor : str ) -> Tuple [List [Any ], Pagination | None ]:
6364 """Fetches the next page of results using a cursor."""
6465 if not next_page_cursor :
65- raise ValueError (
66- "Cannot get the next page with a null next_page_cursor."
67- )
68-
69- params = self . _params . copy ()
70- params [ "page_cursor" ] = next_page_cursor
71- params [ "on_response" ] = lambda response : self . _cache_pagination (
72- response , next_page_cursor
73- )
66+ raise ValueError ("Cannot get the next page with a null next_page_cursor." )
67+
68+ params = {
69+ ** self . _params ,
70+ "page_cursor" : next_page_cursor ,
71+ "on_response" : lambda response : self . _cache_pagination (
72+ response , next_page_cursor
73+ ),
74+ }
7475
7576 data = self ._request (** params )
7677 pagination = self ._pagination_cache .get (next_page_cursor )
0 commit comments