Skip to content

Commit 2a276bd

Browse files
committed
AUTH-1293 was merged, so we can simplify
1 parent 73fe764 commit 2a276bd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cognite/client/_api/user_profiles.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import cast, overload
3+
from typing import overload
44

55
from cognite.client._api_client import APIClient
66
from cognite.client._constants import DEFAULT_LIMIT_READ
@@ -76,16 +76,11 @@ def retrieve(self, user_identifier: str | SequenceNotStr[str]) -> UserProfile |
7676
>>> res = client.iam.user_profiles.retrieve(["bar", "baz"])
7777
"""
7878
identifiers = UserIdentifierSequence.load(user_identifier)
79-
profiles = self._retrieve_multiple(
79+
return self._retrieve_multiple(
8080
list_cls=UserProfileList,
8181
resource_cls=UserProfile,
8282
identifiers=identifiers,
8383
)
84-
if identifiers.is_singleton():
85-
return profiles
86-
# TODO: The API does not guarantee any ordering (against style guidelines, no timeline for fix)
87-
# so we sort manually for now:
88-
return UserProfileList(cast(list[UserProfile], [profiles.get(user) for user in user_identifier]))
8984

9085
def search(self, name: str, limit: int = DEFAULT_LIMIT_READ) -> UserProfileList:
9186
"""`Search for user profiles <https://developer.cognite.com/api#tag/User-profiles/operation/userProfilesSearch>`_

0 commit comments

Comments
 (0)