Skip to content

Commit 14a3fbe

Browse files
vaibhavatlanAryamanz29
authored andcommitted
Fixed the issue with User iteration pagination
1 parent 7340bbf commit 14a3fbe

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyatlan/client/user.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ def get_all(
210210
:param sort: property by which to sort the results, by default : `username`
211211
:returns: a list of all the users in Atlan
212212
"""
213-
response: UserResponse = self.get(offset=offset, limit=limit, sort=sort)
214-
return [user for user in response]
213+
if response := self.get(offset=offset, limit=limit, sort=sort):
214+
return response.records # type: ignore
215+
return None # type: ignore
215216

216217
@validate_arguments
217218
def get_by_email(

pyatlan/model/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _get_next_page(self):
255255
self._criteria.offset = self._start
256256
self._criteria.limit = self._size
257257
raw_json = self._client._call_api(
258-
api=self._endpoint,
258+
api=self._endpoint.format_path_with_params(),
259259
query_params=self._criteria.query_params,
260260
)
261261
if not raw_json.get("records"):

0 commit comments

Comments
 (0)