Skip to content

Commit

Permalink
Update hustle.py
Browse files Browse the repository at this point in the history
This function currently appends the results of pagination to the end of a list, resulting in lists of lists when pulling data with results greater than PAGE_LIMIT (1000). The function should instead join lists.

I'm using the '+' operator, but the '.extend()' method could also be used.
  • Loading branch information
walker-aj authored Oct 7, 2024
1 parent 710532a commit 4cfda2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parsons/hustle/hustle.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _request(self, endpoint, req_type="GET", args=None, payload=None, raise_on_e
parameters["cursor"] = r.json["pagination"]["cursor"]
r = request(req_type, url, params=parameters, headers=headers)
self._error_check(r, raise_on_error)
result.append(r.json()["items"])
result += r.json()["items"]

return result

Expand Down

0 comments on commit 4cfda2a

Please sign in to comment.