Conversation
CI on PR litestar-org#738 surfaced 27 mypy errors across the ADK extension and a docs test failure caused by ADK rst files not being classified. - Tighten ADK model return types: `to_session`/`to_event`/`from_event` now declare ``Session`` and ``Event`` via TYPE_CHECKING imports instead of ``Any``, eliminating downstream ``no-any-return`` errors. - Annotate ``session.scalar`` results in session and artifact services so SQLAlchemy's loose typing no longer bleeds into return values. - Type the ``alchemy`` parameter on Starlette/Sanic plugins with the real ``AdvancedAlchemy`` extension via TYPE_CHECKING imports and drop the now-redundant ``type: ignore`` and runtime isinstance defenses. - Tighten the Flask plugin: type ``app``/``alchemy``/handlers properly and cast the Flask ``g`` cache reads to their concrete service types. - Add mypy overrides for ``pgvector.*``, the unstable Sanic plugin, and the version-gated ADK ``__init__``; drop a stale type ignore on Starlette's ``wrapped_lifespan`` that recent stubs made redundant. - Register the ADK ``docs/usage/adk/*.rst`` pages in ``NON_EXECUTABLE_DOCS`` so the doc tracking test recognizes them. - Fix mypy issues in the ADK examples and tests (assert services, guard optional ``event_data``/``parts``, suppress untyped ``postgresql.dialect`` calls) and allow ``assert`` in ``examples/flask/*`` via ruff per-file-ignores.
Oracle implicitly creates an index for unique constraints, so the ``ix_..._adk_session_lookup`` index on the same (app_name, user_id, session_id) tuple collided with the unique-constraint index and raised ``ORA-01408: such column list already indexed`` during integration test setup. Guard the explicit Index with ``ddl_if`` so it is only emitted on non-Oracle dialects, mirroring the existing pattern in ``SessionModelMixin`` and ``SlugKey``.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
uv run ruff check advanced_alchemy/extensions/adk advanced_alchemy/types/datetime.py tests/unit/test_extensions/test_adk tests/integration/test_extensions/test_adk examples/adk_models.py examples/litestar/adk_example.py examples/fastapi/adk_example.py examples/flask/adk_example.py examples/starlette/adk_example.py examples/sanic_adk_example.pyuv run pytest tests/unit/test_extensions/test_adk tests/integration/test_extensions/test_adk -quv run pyrightuv run make docsgit diff --check