Skip to content

Commit 2fd61ba

Browse files
fix(adms): narrow dict type in get_all to satisfy ty; bump to 0.25.1
1. _document_api.py: type rel_params as dict[str, str | int] (not bare dict) and wrap the get() result in str() before calling .split() — ty couldn't prove the value was str when the dict held int values. Applies to both sync and async get_all. 2. tests/dms/integration: remove two now-unused # ty: ignore directives (conftest.py:17, test_dms_bdd.py:131) that ty 0.25 no longer needs. These were flagged as warnings-turned-errors after the upstream merge bumped ty. 3. pyproject.toml / uv.lock: bump version 0.25.0 → 0.25.1 to satisfy the CI version-bump gate (src/ files changed, version must increase).
1 parent 37b1d84 commit 2fd61ba

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sap-cloud-sdk"
3-
version = "0.25.0"
3+
version = "0.25.1"
44
description = "SAP Cloud SDK for Python"
55
readme = "README.md"
66
license = "Apache-2.0"

src/sap_cloud_sdk/adms/_document_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ def get_all(
5858
ordered by first occurrence across relations.
5959
"""
6060
# Build RelationQueryOptions that always includes Document in $expand.
61-
rel_params: dict = {}
61+
rel_params: dict[str, str | int] = {}
6262
if options:
6363
rel_params = options.to_query_params()
64-
existing_expand = rel_params.get("$expand", "")
64+
existing_expand = str(rel_params.get("$expand", ""))
6565
if existing_expand:
6666
if "Document" not in existing_expand.split(","):
6767
rel_params["$expand"] = existing_expand + ",Document"
@@ -261,10 +261,10 @@ async def get_all(
261261
options: DocumentQueryOptions | None = None,
262262
) -> list[Document]:
263263
"""Async variant of :meth:`_DocumentApi.get_all` — same semantics."""
264-
rel_params: dict = {}
264+
rel_params: dict[str, str | int] = {}
265265
if options:
266266
rel_params = options.to_query_params()
267-
existing_expand = rel_params.get("$expand", "")
267+
existing_expand = str(rel_params.get("$expand", ""))
268268
if existing_expand:
269269
if "Document" not in existing_expand.split(","):
270270
rel_params["$expand"] = existing_expand + ",Document"

tests/dms/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def dms_client():
1414
client = create_client(instance="default")
1515
return client
1616
except Exception as e:
17-
pytest.skip(f"DMS integration tests require credentials: {e}") # ty: ignore[invalid-argument-type, too-many-positional-arguments]
17+
pytest.skip(f"DMS integration tests require credentials: {e}")
1818

1919

2020
def _setup_cloud_mode():

tests/dms/integration/test_dms_bdd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def select_version_repo(context: DMSTestContext, dms_client: DMSClient):
128128
version_repo = r
129129
break
130130
if version_repo is None:
131-
pytest.skip("No version-enabled repository available") # ty: ignore[invalid-argument-type, too-many-positional-arguments]
131+
pytest.skip("No version-enabled repository available")
132132
context.repo = version_repo
133133
context.repo_id = version_repo.id
134134

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)