Skip to content

Commit a66ae61

Browse files
committed
bugfix: add an arbitrary limit to fetch all datasets, but avoid pagination code
1 parent dcd40f8 commit a66ae61

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

v03_pipeline/lib/misc/terra_data_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _tdr_request(resource: str) -> dict:
3131

3232

3333
def _get_dataset_ids() -> list[str]:
34-
res_body = _tdr_request('datasets')
34+
res_body = _tdr_request('datasets?limit=50000') # Arbitrary large number :/
3535
items = res_body['items']
3636
for item in items:
3737
if not any(x['cloudResource'] == BIGQUERY_RESOURCE for x in item['storage']):

v03_pipeline/lib/misc/terra_data_repository_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TerraDataRepositoryTest(unittest.TestCase):
137137
@responses.activate
138138
def test_get_dataset_ids(self, _: Mock) -> None:
139139
responses.get(
140-
os.path.join(TDR_ROOT_URL, 'datasets'),
140+
os.path.join(TDR_ROOT_URL, 'datasets?limit=50000'),
141141
body=json.dumps(
142142
{
143143
'total': 3,

0 commit comments

Comments
 (0)