Skip to content

Commit 50acea1

Browse files
committed
fix: resolve ruff lint and mypy strict typecheck issues
- Fix import sorting (ruff I001) - Add explicit str()/int() casts for resp.json().get() returns (mypy no-any-return in strict mode)
1 parent 3b063fa commit 50acea1

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/hawk/composio_cognee.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from .errors import parse_error
1919
from .retry import DEFAULT_RETRY_CONFIG, RetryConfig, with_retry_sync
2020

21-
2221
# --- Composio Types ---
2322

2423
@dataclass
@@ -224,7 +223,7 @@ def _do_remember() -> str:
224223
)
225224
if resp.status_code != 200:
226225
raise parse_error(resp)
227-
return resp.json().get("id", "")
226+
return str(resp.json().get("id", ""))
228227

229228
return with_retry_sync(_do_remember, retry_config)
230229

@@ -259,7 +258,7 @@ def _do_remember() -> str:
259258
})
260259
if resp.status_code != 200:
261260
raise parse_error(resp)
262-
return resp.json().get("id", "")
261+
return str(resp.json().get("id", ""))
263262

264263
return with_retry_sync(_do_remember, retry_config)
265264

@@ -290,7 +289,7 @@ def _do_remember() -> str:
290289
})
291290
if resp.status_code != 200:
292291
raise parse_error(resp)
293-
return resp.json().get("id", "")
292+
return str(resp.json().get("id", ""))
294293

295294
return with_retry_sync(_do_remember, retry_config)
296295

@@ -325,7 +324,7 @@ def _do_remember() -> str:
325324
})
326325
if resp.status_code != 200:
327326
raise parse_error(resp)
328-
return resp.json().get("id", "")
327+
return str(resp.json().get("id", ""))
329328

330329
return with_retry_sync(_do_remember, retry_config)
331330

@@ -386,7 +385,7 @@ def _do_sync() -> int:
386385
)
387386
if resp.status_code != 200:
388387
raise parse_error(resp)
389-
return resp.json().get("promoted", 0)
388+
return int(resp.json().get("promoted", 0))
390389

391390
return with_retry_sync(_do_sync, retry_config)
392391

@@ -416,6 +415,6 @@ def _do_recall() -> str:
416415
})
417416
if resp.status_code != 200:
418417
raise parse_error(resp)
419-
return resp.json().get("context", "")
418+
return str(resp.json().get("context", ""))
420419

421420
return with_retry_sync(_do_recall, retry_config)

0 commit comments

Comments
 (0)