Commit 5ed1ff3
committed
fix(memory): resolve 3 new mypy errors flagged by mypy-diff CI
Addresses the mypy-new-error gate failures on Python 3.10/3.13:
- memory/__init__.py: add `-> Any` return annotation to the lazy
`__getattr__(name)` so it satisfies `no-untyped-def`. Matches the
convention used by `tools/__init__.py` and `skills/__init__.py`.
- memory/_memory_schemas.py: silence SQLAlchemy's `DeclarativeBase`
type-stub `Any` base-class warning (same pattern as other places
where SQLAlchemy is used; pre-existing analogous errors in
sessions/schemas/{v0,v1}.py are grandfathered on main).
- memory/database_memory_service.py: annotate `__aexit__` parameters
so mypy no longer flags `no-untyped-def`.
Verified locally:
* `mypy .` reports zero errors in the three new files
(the mypy-diff gate compares against main; all remaining errors
under `src/google/adk/memory/` are pre-existing on main).
* All 19 DatabaseMemoryService unit tests still pass.
* pyink --check and isort --check-only are clean.1 parent 9490b57 commit 5ed1ff3
3 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
309 | 315 | | |
310 | 316 | | |
311 | 317 | | |
| |||
0 commit comments