@@ -48,11 +48,12 @@ def _cache_pagination(self, response: Dict[str, Any], page_key: str) -> None:
48
48
49
49
def first_page (self ) -> Tuple [List [Any ], Pagination | None ]:
50
50
"""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
+ }
56
57
57
58
data = self ._request (** params )
58
59
pagination = self ._pagination_cache .get (self ._FIRST_PAGE )
@@ -62,15 +63,15 @@ def first_page(self) -> Tuple[List[Any], Pagination | None]:
62
63
def next_page (self , next_page_cursor : str ) -> Tuple [List [Any ], Pagination | None ]:
63
64
"""Fetches the next page of results using a cursor."""
64
65
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
+ }
74
75
75
76
data = self ._request (** params )
76
77
pagination = self ._pagination_cache .get (next_page_cursor )
0 commit comments