-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ignore unknown ids in functions (#1372)
- Loading branch information
Showing
5 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from __future__ import annotations | ||
|
||
__version__ = "6.24.1" | ||
__version__ = "6.25.0" | ||
__api_subversion__ = "V20220125" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
from cognite.client import CogniteClient | ||
from cognite.client.exceptions import CogniteNotFoundError | ||
|
||
|
||
class TestFunctionsAPI: | ||
def test_retrieve_unknown_raises_error(self, cognite_client: CogniteClient): | ||
with pytest.raises(CogniteNotFoundError) as e: | ||
cognite_client.functions.retrieve_multiple(external_ids=["this does not exist"]) | ||
|
||
assert e.value.not_found[0]["external_id"] == "this does not exist" | ||
|
||
def test_retrieve_unknown_ignore_unknowns(self, cognite_client: CogniteClient): | ||
res = cognite_client.functions.retrieve_multiple(external_ids=["this does not exist"], ignore_unknown_ids=True) | ||
assert len(res) == 0 |