Skip to content

Missing API reference for DatabaseSessionService #4331

Closed

Description

@olliefr

The API Reference for google.adk.sessions module no longer mentions DatabaseSessionService at all.

I think this has to do with lazy loading of DatabaseSessionService:

src/google/adk/sessions/__init__.py

I have a feeling that your docs generator fails to comprehend the deferred import (via __getattr__) but it's not my area of expertise, really, so it's just a guess.

Activity

  1. koverholt commented on Jan 30, 2026

    @koverholt
    Collaborator

    Thanks for the issue! Agree that this looks related to lazy loading of modules.

    We generate API docs from the Python library and then vendor them into [the adk-docs] repo to be served with the rest of the ADK docs.

    Since this would need to be fixed in the upstream adk-python repo, I'll transfer this issue there, where they can investigate this see if there is a fix for the missing DatabaseSessionService info in their API docs config / generation process.

  2. transferred this issue fromgoogle/adk-docson Jan 30, 2026
  3. added
    documentation[Component] This issue is related to documentation, it will be transferred to adk-docs
    on Jan 30, 2026
  4. added theissue type on Jan 30, 2026
  5. surajksharma07 commented on Feb 9, 2026

    @surajksharma07
    Collaborator

    @olliefr — the __getattr__ lazy loading in sessions/__init__.py (lines 30-41) is why sphinx autodoc can't find DatabaseSessionService.

    The class is in __all__ but not in the module's __dict__ after import, so docs generators skip it entirely.

    The fix is to replace the __getattr__ with a try/except ImportError at module level: try: from .database_session_service import DatabaseSessionService / except ImportError: pass.

    This keeps the optional sqlalchemy dependency handling while making the class visible to dir() and docs tools.

    Team is looking more into it.

  6. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Feb 9, 2026
  7. olliefr commented on Feb 15, 2026

    @olliefr
    Author

    @wuliang229 thank you for picking this up. It would be great to have this fixed. I sometimes onboard teams to ADK and in my experience newcomers find the omission of DatabaseSessionService from the docs confusing. So I am really looking forward to seeing it fixed 🙂

  8. removed
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Feb 23, 2026
  9. Akshat8510 commented on Feb 24, 2026

    @Akshat8510
    Contributor

    Hi @wuliang229, If you haven't had a chance to start yet, I'd be happy to take this on and implement the fix suggested by @surajksharma07 (replacing the lazy __getattr__ with a top-level try/except block).

  10. Akshat8510 commented on Feb 24, 2026

    @Akshat8510
    Contributor

    I've noticed how important this is for onboarding new users to ADK, so I'd love to help get it into the API reference. Let me know if I should open a PR!

  11. wuliang229 commented on Feb 24, 2026

    @wuliang229
    Collaborator

    @Akshat8510 feel free to raise a PR

  12. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on Mar 4, 2026
  13. adk-bot commented on Mar 4, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  14. added
    stale[Status] Issues which have been marked inactive since there is no user response
    on Mar 4, 2026
  15. Akshat8510 commented on Mar 4, 2026

    @Akshat8510
    Contributor

    Hi @adk-bot and @wuliang229, this issue is still very much active. I have submitted PR #4608 which implements the faithful placeholder fix for DatabaseSessionService. I have already addressed all architectural feedback from the AI bot, including Mypy type hints and exception chaining. The PR is ready for a final human review!

  16. removed
    stale[Status] Issues which have been marked inactive since there is no user response
    on Mar 5, 2026
  17. olliefr commented on Mar 6, 2026

    @olliefr
    Author

    Hello, @Akshat8510 and @wuliang229. I concur that this issue is very much an ongoing issue since the API documentation still does not include the information on on DatabaseSessionService and there is nothing positive about that.

    Thank you, @Akshat8510 for having submitted the PR. I hope it gets reviewed and merged soon.

    @adk-bot this is not a stale issue at all. We are waiting on a response from a maintainer since the issues raised in the review had been addressed.

  18. added a commit that references this issue on Jun 16, 2026
    69ecf07
  19. added a commit that references this issue on Aug 11, 2026
    ca1aacf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentation[Component] This issue is related to documentation, it will be transferred to adk-docsrequest clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions