cognitedata / cognite-sdk-python

Cognite Python SDK
https://cognite-sdk-python.readthedocs-hosted.com/
Apache License 2.0
76 stars 27 forks source link

Support loading non-items in API responses #1843

Closed haakonvt closed 1 month ago

haakonvt commented 1 month ago

Description

Adds the possibility of loading the full response(s) - and hence any other data than items - to _retrieve_multiple and _list via _list_generator_raw_responses.

It also simplifies and abstracts out a lot of details from _list_generator to ease future dev work.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 69.66292% with 27 lines in your changes missing coverage. Please review.

Project coverage is 92.32%. Comparing base (8850a8b) to head (71091a5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1843 +/- ## ========================================== - Coverage 92.37% 92.32% -0.06% ========================================== Files 124 124 Lines 18501 18539 +38 ========================================== + Hits 17091 17116 +25 - Misses 1410 1423 +13 ``` | [Files](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1843?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata) | Coverage Δ | | |---|---|---| | [cognite/client/data\_classes/\_base.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1843?src=pr&el=tree&filepath=cognite%2Fclient%2Fdata_classes%2F_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata#diff-Y29nbml0ZS9jbGllbnQvZGF0YV9jbGFzc2VzL19iYXNlLnB5) | `92.77% <100.00%> (+0.03%)` | :arrow_up: | | [cognite/client/utils/\_concurrency.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1843?src=pr&el=tree&filepath=cognite%2Fclient%2Futils%2F_concurrency.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata#diff-Y29nbml0ZS9jbGllbnQvdXRpbHMvX2NvbmN1cnJlbmN5LnB5) | `90.95% <66.66%> (+2.17%)` | :arrow_up: | | [cognite/client/\_api\_client.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1843?src=pr&el=tree&filepath=cognite%2Fclient%2F_api_client.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata#diff-Y29nbml0ZS9jbGllbnQvX2FwaV9jbGllbnQucHk=) | `86.64% <69.04%> (-3.20%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1843/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata)