diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0e85fb..28440198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Recursion error in `get_items` [#608](https://github.com/stac-utils/pystac-client/pull/608) + ## [v0.7.5] - 2023-09-05 ### Fixed diff --git a/pystac_client/client.py b/pystac_client/client.py index a8827339..d85f1c9e 100644 --- a/pystac_client/client.py +++ b/pystac_client/client.py @@ -438,12 +438,14 @@ def get_collections(self) -> Iterator[Collection]: call_modifier(self.modifier, collection) yield collection - def get_items(self, *ids: str, recursive: bool = False) -> Iterator["Item_Type"]: + def get_items( + self, *ids: str, recursive: Optional[bool] = None + ) -> Iterator["Item_Type"]: """Return all items of this catalog. Args: ids: Zero or more item ids to find. - recursive: unused + recursive: unused in pystac-client, but needed for falling back to pystac Return: Iterator[Item]: Iterator of items whose parent is this @@ -454,7 +456,9 @@ def get_items(self, *ids: str, recursive: bool = False) -> Iterator["Item_Type"] yield from search.items() else: self._warn_about_fallback("ITEM_SEARCH") - for item in super().get_items(*ids, recursive=True): + for item in super().get_items( + *ids, recursive=recursive is None or recursive + ): call_modifier(self.modifier, item) yield item diff --git a/tests/cassettes/test_client/test_non_recursion_on_fallback.yaml b/tests/cassettes/test_client/test_non_recursion_on_fallback.yaml new file mode 100644 index 00000000..3e1284b7 --- /dev/null +++ b/tests/cassettes/test_client/test_non_recursion_on_fallback.yaml @@ -0,0 +1,543 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/catalog.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA52QMQvCMBCFd39FyNzUdhM3cXXTTYqE5KrRIynJIUrxv5vEFjuIgsvBve/du+P6 + GWOc7h3wJeNrSRLdkRdJDCTV4Qo+GGcTrMuqrCYIbgQ2wRDpvsnA6OREaXWQJJJNKIcIiqJPqGk8 + GcK8dLtbrVnrPNu8xpiOtpdHQ1DedDRc8MWJxl7yHbFhrM81yicPbZos58Pu8hxiVjFyD5hwAGx5 + 1h7FXwHeOfoVMH5lIbCev7/yOVCdDOohMdZm9ngCaHKhLKkBAAA= + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '209' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"4f517310845b65ca442e14b6613d76cdc06523f64710d84a6d49b93c49d0dca9" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - ce8fb12ade66846f275360de1601c9b8144ed210 + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - 64A8:1094:3C6D0E:4B2723:653A7C28 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.158574,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/landsat-8-l1/collection.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA62WUY+bOBCA3/MrLJ7upA3BBAjJ43WrU6X0Trr2qadV5MAk8dVgZJtkc6v899o4 + BHbbBbfal0BmhpnPM2N7niYI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FmRhrxMusu/lf8SGC7US92OElm63dpgKNgPjcCnCTrP/8Kglcc + Uz0rOTqOreM4mIeN4wi/kePFzbElTpdv5NimYh78dComZoa7TL4B6HBASoQNAAA= + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '959' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"d7e83b66298977e660cd41eced9df63c47c5075485bc81bbb67f17a4df051e24" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - e2ab76c2387ceb18ea9fef4c9ec154b42abd21c8 + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - EF5A:09B8:E9C1C:1132F6:653A8D05 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.185206,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/landsat-8-l1/2018-06/LC80140332018166LGN00.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA9WZXW/bNhSG7/MrBF15gC2RFElRvmsKtCvgdu3mqxWBwNi0zEwfnkTHSYP895GS + LcuZbAmegdU3/iCPDnne5xxSol5uLMtWzythjy37g+BqnQt7aBrl3DRN3jMAMfA8BCCDlE4+fgGg + MigUn4WPIi9kltqWtoUOcJp94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tmNE52FE1uA+XosrYIguyhD1ZUh7MWQnGRqFOwF65wH0rEGUC5FeAUHv + ogS9ixIk9CTBUuJOhPg8hNga5GJ+BQDxRQHivgBxH4CUnASoBe7ER87DR6xBKvMrwEcuio/0xef1 + wcdO158WuBMfPQ8ftQbFRuaQXgFBelGCtC9B1k0QOqcBVhJ3MvTPY+hXDBG6Aob+RRn6PRmiHvei + yEGdDBHqZMjOY8iswYpfw20MuyhA1hMg7FGE+jYmOElQC9yJLzgPX6CfB2Wer4srIBhclGBwwcdB + 6Hj+SYKVxp0QITjzqR5Yg3hzFXczEFz2oR70xNhnMwTO6To0EkPYTfHcsxl4PRQvfDTT72wG9mB4 + ei808nZuhe++fGw9i3yXRrGwZplYLORMmpN5ayHjljPJ8oB2FXOZ/vQkdayOelKdp7Sfp5NWTbJc + RjLlsZUIxedc8euXRIfaS5Lbb+9aJSlr+e81j6V6towkxw6tD9eCn1QNHeWxUr/ZlVD1/iKW6V/7 + aq91yYU52bcLEbcE67it78Trt8O12m/drXiuC7DFoePuX/V1u2m8FvyvrvIsa5+P8aOzIM6ippMb + s+q83vwDIQ4VojMgAAA= + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '1382' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"4aeda1cb7469bd902a948455e21ccb8b8cec0e530c5f287fa31532aeba8a4b4c" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - d1db05b24f72bf1f5534f52407cb4569280ba2d7 + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - 23B0:694B:A6D57:C5ED0:653A8D04 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.213681,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/landsat-8-l1/2018-05/LC80150322018141LGN00.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA9WZXW+jOBSG7/srUK6yUgK2MWByNx1pZitlZmd2c7WjCrnEIe6ajwWnaafqf18b + CiFdElA20jaKlA/7cOzzPufYxDxfGcZIPmVsNDNGnxiVm5yNJrqRL3XT/CMB0AE2QgASiOH881cA + KoNC0jB4YHnB02RkKFtoArPdxx4lS3Rvobt/qHbVs5YyK2aWpS2mOwsz4nK9uTN5arHUeoCmcmYV + 4ZrF1Lwv1ACToZc/cLbVDsCpDrI8vWehVK1d81BebssQ7+7Sx1Ed1tTzTEKQT6pRbN9ENvDsyWun + YwLPsZ3qJ4YmhgChxlPE0pjJ/El5e64mWQP5loqnaDf3ME3zJU+oZEUzstF8tr9VM0LEh9D3XIDU + y520evUcgA+R7WMb2Rj5Td/t5IC7MgbP9YjtAOBhsucOmL4HXYSw56gxbXuIO9clHnJtiD2bIK/t + rpQPQeBj3yHqBfvdKfk9H7seAK6DISRv3Llq4r4PCcZKkwHBnqjdVftTv7+UgMNUiCqjNFRBk2VB + 5ZRMBayqRWVcxnLJS6zPNeuj1yiLpcoDyeMyUXR1ToEzRXABnRnGM8f/s7bTBTErNklAf/J4I9fK + HtrYJIAgF3tvjZhgD/R1WBebAGDgerA2Y+ksFOlmGYSpqnxlgl87eFLIfBOzRJapOfptfhMsbn7/ + Y3TbHiBdrYKELrm+Erx2ZILKVZrHe2HWc48KvQrZja0q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dg/6+t20Hgr+V1d5mnbPR/tRWSDSqO3kSq86 + L1f/APHhN9EvIAAA + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '1380' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"cd518c56745214a4d20ae145f9fb6edf689b57fc9ac77e1d3592c1476949550f" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - d3ef3f1bd728171e81f4bf11096eb9d348038c66 + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - 28BE:911F:2EB4CC:376B99:653A8D04 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.240597,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/landsat-8-l1/2018-07/LC80150332018189LGN00.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA9WZXW/bNhSG7/MrBF15gE2JEilSvmsKtCvgdu3mqxWBwNi0zIz6mETHSYP895FS + bEuZYgmegdW5sB3y6JDnfc4hJerpyrJs9Zhze2rZHzhTm4LbY9MolqZp9p66ELu+77mQQhrOPn5x + 3dqgVGwR3fOiFFlqW9oWAhc0+/iD4qnpLU33d92ue9ZK5eXUcYzF5GABYqHWm1sgModnzj0E2plT + L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HCVYSdyLEJ2GEFmjgi8vACA6K0A0FCAaAjDARwFqgXvx4dPwYWuUiuIC8OGz4sND8flD8NHj9acF + 7sUXnIYvsEblVhQwuACCwVkJBkMJ0n6CEBwHWEvcy5CcxpDUDD3vAhiSszIkAxl6A+5FPeD1MvS8 + Xob0NIbUGuXsEm5j6FkB0oEA4YAi1Lcx4VGCWuBefOFp+EL9PCiKYlNeAMHwrATDMz4OQuCTowRr + jXshQvfEp3rXGsntRdzNQPe8D/XuQIxDNkMXHK9DIzGE/RRPPZuBl0PxzEczw85m4ACGx/dCI2/v + Vvjuy8fOs8h3aSy5tcj4aiUWwpzHWyshO84kqwPaXDKR/vQkdaxAPajeU9rP81mnJlkhYpEyaSVc + sSVT7PIl0aEOkuT627tOSapa/nvDpFCPlpHkrUPr9lrwk6qho3yr1K92JVS/v5Ai/etQ7XtdCm5O + 9u2Sy45ggdP5Inz/Sniv9mt3OSt0AXY4BM7h9V6/m8arwP/qqsiy7vkYPzoLZBY3nVyZVef56h97 + 1zB+KCAAAA== + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '1375' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"f1956bfe0994b5049095141c760f2d24f565019a6e81e1aec1816740157df998" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - 65f1fd239f34ccc6c8466fb55a74977e459cc224 + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - B012:41DA:BB439:DA8AA:653A8D05 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.270042,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/landsat-8-l1/2018-06/LC80300332018166LGN00.json + response: + body: + string: !!binary | + H4sIAAAAAAAAA9WZXW+jOBSG7/srUK6yUmNsY4zJ3XSkmR0pMzuzm6sdVcglDnGXjyw4TTtV//va + kBDo0oCykXZSqQmxD8c+73OOAfN8ZVkj9bQWo6k1+iC42uRidG0aC8XD4EHkhczSkaV7EYAANvrE + oxKp6S1M93fdrntWSq2LqW0bi8nBAkRSrTZ3QGa2yOwHBLQzuwhXIuHgvtADXA89/UGKrXEAT3Ww + zrN7ESrd2jUP7eW2DFEujCKz9ww6EDoOhoghSmcfv8CdBnd32eNoH/cEQQQI9HynmofjAYYgI9Wv + ic8A9TDa9fnA9wj166EikSVC5U/a23MVxR7I1yx+ig7BhVmWL2TKlSjqka36u3lUzggCRhzK9KwI + cjy4G776KyeBESQ+0tERSuu+2+tuf2UMxMeUIA/5kNBX7lzCHAc6HnUdRNx+dz7Ajk8o9LR0xmfL + nZFPT5kxRKDWvd9dpb9LIXEY8bDrui1/DGBCPMo8TD1GvSH+TlTvqvltPl9KxmEWx1XWGa4xTxcF + VxM2iVGVTTor1yJXsiT7vMd99BxtsdCpoGRS5orJ0AmkE+TOkTdFbAqdP/d2pmimxSYN+A+ZbNRK + 2yPsAtfzfR/5r41ELB74blhKNVid2JjgnZnIpmGcbRZBmOnVQZvAXYdMC5VvEpGqMjtHv80+BfNP + v/8xum0OkC2XQcoXsnnmOuZqmeVJK8z93KPCVKJT2+rynYp1EZlGTBFptqucp8XO03fsE8xcAK/1 + yeaz/CAEuxC59e+JA2+bHv5Vi29W45v12M6kxj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AA== + headers: + Accept-Ranges: + - bytes + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=300 + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '1384' + Content-Security-Policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + Content-Type: + - text/plain; charset=utf-8 + Cross-Origin-Resource-Policy: + - cross-origin + Date: + - Thu, 26 Oct 2023 16:02:45 GMT + ETag: + - W/"6da3b66dc885889ceff60c1a0618fcc959b22734a7a4d9646fe0f55f0869ca5f" + Expires: + - Thu, 26 Oct 2023 16:07:45 GMT + Source-Age: + - '160' + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization,Accept-Encoding,Origin + Via: + - 1.1 varnish + X-Cache: + - HIT + X-Cache-Hits: + - '1' + X-Content-Type-Options: + - nosniff + X-Fastly-Request-ID: + - 5859b8ab7d05ab9b05e76220ac540ca9d9fa009e + X-Frame-Options: + - deny + X-GitHub-Request-Id: + - 428E:420E:AEC53:CE3F9:653A8D05 + X-Served-By: + - cache-lga21923-LGA + X-Timer: + - S1698336165.295836,VS0,VE1 + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_client.py b/tests/test_client.py index bd5a4085..03ed22cc 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -703,3 +703,11 @@ def test_get_items_without_ids() -> None: "https://planetarycomputer.microsoft.com/api/stac/v1/", ) next(client.get_items()) + + +@pytest.mark.vcr +def test_non_recursion_on_fallback() -> None: + path = "https://raw.githubusercontent.com/stac-utils/pystac/v1.9.0/docs/example-catalog/catalog.json" + catalog = Client.from_file(path) + with pytest.warns(FallbackToPystac): + [i for i in catalog.get_items()]