Skip to content

Commit c646129

Browse files
committed
fix: Use property for TypedResponse.data to improve mypy type inference
- Convert data attribute to property with explicit T return type - This should help mypy better understand the generic type relationship - Bump version to 0.1.17 - Properties provide clearer type information than direct attributes
1 parent ee1842c commit c646129

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
]
2727
keywords = ["blockchain", "ethereum", "solana", "defi", "nft", "api", "thegraph", "web3", "crypto"]
2828
dependencies = [
29-
"divine-requests==0.1.15",
29+
"divine-requests==0.1.16",
3030
"divine-type-enforcer==0.1.8",
3131
"anyio>=4.0.0",
3232
]

src/thegraph_token_api/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ async def get_version(self) -> VersionResponse:
8080
response = await self.manager.get(
8181
f"{self.base_url}/version", headers=self._headers, expected_type=VersionResponse
8282
)
83-
# Type assertion to help mypy understand divine-requests TypedResponse
8483
return response.data # type: ignore[no-any-return]
8584

8685
async def get_networks(self) -> NetworksResponse:
@@ -93,5 +92,4 @@ async def get_networks(self) -> NetworksResponse:
9392
response = await self.manager.get(
9493
f"{self.base_url}/networks", headers=self._headers, expected_type=NetworksResponse
9594
)
96-
# Type assertion to help mypy understand divine-requests TypedResponse
9795
return response.data # type: ignore[no-any-return]

src/thegraph_token_api/evm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ async def get_balances(
313313
params=params,
314314
expected_type=BalancesResponse,
315315
)
316-
# Return the full response object
317316
return response.data # type: ignore[no-any-return]
318317

319318
# ===== Transfer Methods =====

0 commit comments

Comments
 (0)