cognitedata / cognite-sdk-python

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

Retrieve/list responses with more than items #1839

Closed doctrino closed 1 month ago

doctrino commented 2 months ago

Description

This is a preparation for #1691

Problem

The _list and _retrieve_multiple methods does account for any other than items in the response object: image

This PR gives the option to get the typing key from the response.

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.

Project coverage is 92.36%. Comparing base (2aa4995) to head (9df291f). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1839 +/- ## ========================================== - Coverage 92.46% 92.36% -0.11% ========================================== Files 124 124 Lines 18445 18461 +16 ========================================== - Hits 17056 17052 -4 - Misses 1389 1409 +20 ``` | [Files](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839?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/\_api/data\_modeling/instances.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839?src=pr&el=tree&filepath=cognite%2Fclient%2F_api%2Fdata_modeling%2Finstances.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata#diff-Y29nbml0ZS9jbGllbnQvX2FwaS9kYXRhX21vZGVsaW5nL2luc3RhbmNlcy5weQ==) | `87.40% <100.00%> (-0.23%)` | :arrow_down: | | [cognite/client/data\_classes/\_base.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839?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.75% <100.00%> (+0.01%)` | :arrow_up: | | [cognite/client/utils/\_concurrency.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839?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) | `88.38% <50.00%> (-0.40%)` | :arrow_down: | | [cognite/client/\_api\_client.py](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839?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=) | `89.62% <77.77%> (-0.51%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/cognitedata/cognite-sdk-python/pull/1839/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cognitedata)
doctrino commented 1 month ago

Solved by alternative approach in #1843 instead