Skip to content

chore: Improves session update time validation message #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/google/adk/sessions/database_session_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,11 @@ def append_event(self, session: Session, event: Event) -> Event:

if storage_session.update_time.timestamp() > session.last_update_time:
raise ValueError(
f"Session last_update_time {session.last_update_time} is later than"
f" the upate_time in storage {storage_session.update_time}"
)
f"Session last_update_time "
f"{datetime.fromtimestamp(session.last_update_time):%Y-%m-%d %H:%M:%S} "
f"is later than the update_time in storage "
f"{storage_session.update_time:%Y-%m-%d %H:%M:%S}"
)

# Fetch states from storage
storage_app_state = sessionFactory.get(
Expand Down