Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v1.15.2
- Update `property_v2.search` to fix limit logic bug.

### v1.15.1
- Fix bug where `OTHER` property type was not being allowed in the `property_types` parameter in the `property_v2.search` endpoint.

Expand Down
2 changes: 1 addition & 1 deletion parcllabs/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.15.1"
VERSION = "1.15.2"
3 changes: 2 additions & 1 deletion parcllabs/services/properties/property_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def _fetch_post(self, params: dict[str, Any], data: dict[str, Any]) -> list[dict
if pagination:
limit = pagination.get("limit")
returned_count = metadata.get("results", {}).get("returned_count", 0)
if returned_count < limit: # if we got fewer results than requested, don't paginate
# if we got fewer or equal results than requested, don't paginate
if returned_count <= limit:
return all_data

# If we need to paginate, use concurrent requests
Expand Down
4 changes: 2 additions & 2 deletions tests/test_property_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ def test_fetch_post_pagination(mock_post: Mock, property_v2_service: PropertyV2S

result = property_v2_service._fetch_post(params={"limit": 1}, data={})

assert len(result) == 2
assert len(result) == 1
assert result[0]["data"][0]["parcl_id"] == 123
assert mock_post.call_count == 2
assert mock_post.call_count == 1


def test_as_pd_dataframe(property_v2_service: PropertyV2Service, mock_response: Mock) -> None:
Expand Down