Skip to content
2 changes: 1 addition & 1 deletion src/albert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__all__ = ["Albert", "AlbertClientCredentials", "AlbertSSOClient"]

__version__ = "1.11.2"
__version__ = "1.11.3"
17 changes: 9 additions & 8 deletions src/albert/collections/btinsight.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from albert.core.session import AlbertSession
from albert.core.shared.enums import OrderBy, PaginationMode
from albert.core.shared.identifiers import BTInsightId
from albert.core.utils import ensure_list
from albert.resources.btinsight import BTInsight, BTInsightCategory, BTInsightState


Expand Down Expand Up @@ -132,17 +133,17 @@ def search(
"""
params = {
"offset": offset,
"order": OrderBy(order_by).value if order_by else None,
"order": order_by,
"sortBy": sort_by,
"text": text,
"name": name,
"name": ensure_list(name),
}
if state:
state = state if isinstance(state, list) else [state]
params["state"] = [BTInsightState(x).value for x in state]
if category:
category = category if isinstance(category, list) else [category]
params["category"] = [BTInsightCategory(x).value for x in category]

state_values = ensure_list(state)
params["state"] = state_values if state_values else None

category_values = ensure_list(category)
params["category"] = category_values if category_values else None

return AlbertPaginator(
mode=PaginationMode.OFFSET,
Expand Down
2 changes: 1 addition & 1 deletion src/albert/collections/cas.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_all(
An iterator over Cas entities.
"""

params: dict[str, Any] = {"orderBy": order_by.value}
params: dict[str, Any] = {"orderBy": order_by}
if id is not None:
yield self.get_by_id(id=id)
return
Expand Down
6 changes: 3 additions & 3 deletions src/albert/collections/companies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from albert.core.pagination import AlbertPaginator, PaginationMode
from albert.core.session import AlbertSession
from albert.core.shared.identifiers import CompanyId
from albert.core.utils import ensure_list
from albert.exceptions import AlbertException
from albert.resources.companies import Company

Expand Down Expand Up @@ -62,9 +63,8 @@ def get_all(
"dupDetection": "false",
"startKey": start_key,
}
if name:
params["name"] = name if isinstance(name, list) else [name]
params["exactMatch"] = str(exact_match).lower()
params["name"] = ensure_list(name)
params["exactMatch"] = str(exact_match).lower()

return AlbertPaginator(
mode=PaginationMode.KEY,
Expand Down
Loading