Skip to content

Commit

Permalink
fixed limits & test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienJaussaudGeosys committed May 24, 2024
1 parent 2e60215 commit af1bcbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions geosyspy/services/master_data_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def retrieve_season_fields_in_polygon(self, polygon: str):
self.base_url,
GeosysApiEndpoints.MASTER_DATA_MANAGEMENT_ENDPOINT.value + "/seasonfields",
'?fields=geometry,id'
+ '&$limit=none'
)
return self.http_client.get(api_call)

Expand Down Expand Up @@ -219,6 +220,7 @@ def get_season_fields(self, season_field_ids: [str]):
GeosysApiEndpoints.MASTER_DATA_MANAGEMENT_ENDPOINT.value
+'/seasonfields?$fields=id,geometry' #add other fields if needed
+'&Id=$in:' + '|'.join(season_field_ids)
+'&$limit=none'
)

response = self.http_client.get(mdm_url)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_unit_master_data_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ def test_get_season_fields(self, get_response):
"master_data_management_retrieve_sfids_mock_http_response"), status_code=201)

response = self.service.get_season_fields(sfids)
assert response.status_code == 200
assert len(response) == 20

0 comments on commit af1bcbe

Please sign in to comment.