SQLite migration reports the source event count after skipping rows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
調査の方向性
google/adk/sessions/migration/migrate_from_sqlalchemy_sqlite.py から始め、カウント動作を migrate_from_sqlalchemy_pickle.py と比較します。tests/unittests/sessions/migration/test_migration.py::test_sqlite_migration_reports_only_migrated_events を実行します。完了とは、変換に失敗した場合に移行先に成功した行だけが残り、移行ログが移行されたイベントとスキップされたイベントを正確に識別することです。
索引モデルが issue の本文から書いたものです。
説明
🔴 Required Information
Describe the Bug:
migrate_from_sqlalchemy_sqlite.migrate skips any event row whose to_event() raises, logs a per-row warning, and then reports Migrated {len(events)} events. — the number of rows in the source table, not the number inserted. The transaction is committed and the run ends with Migration completed successfully., so a migration that permanently dropped events reports the full count. The pickle migration in the same package already counts successful inserts (num_rows in migrate_from_sqlalchemy_pickle.py).
Steps to Reproduce:
- Create a v0 SQLite database with one session and two event rows.
- Make one row unconvertible, e.g. by making
StorageEvent.to_event()raise for it. - Run
python -m google.adk.sessions.migration.migrate_from_sqlalchemy_sqlite --source_db_url sqlite:///source.db --dest_db_path dest.db. - Read the log.
Expected Behavior:
The summary counts the rows that were actually migrated, and the rows that were skipped are named, so the operator can tell the destination is incomplete before following the script's own "rename your database" instruction.
Observed Behavior:
WARNING ... Failed to migrate event event2: unreadable event payload
INFO ... Migrated 2 events.
INFO ... Migration completed successfully.
dest.db contains one event row (event1).
Environment Details:
- ADK Library Version: main @ 044a1ec3
- Desktop OS: macOS
- Python Version: 3.14.5
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A (offline migration script)
🟡 Optional Information
Regression:
The count has been the source row count since the script was added.
Logs:
INFO ... Migrating events...
WARNING ... Failed to migrate event event2: unreadable event payload
INFO ... Migrated 2 events.
INFO ... Migration completed successfully.
Additional Context:
I hit this while auditing the two migration scripts against each other. A regression test that builds a two-event source DB, fails one conversion, and asserts the log reports Migrated 1 events. fails on main today. I have a fix ready that counts successful inserts and adds one warning naming the skipped ids; happy to open the PR, or to keep it even smaller if you would rather only fix the count.
Minimal Reproduction Code:
The test in the PR (tests/unittests/sessions/migration/test_migration.py::test_sqlite_migration_reports_only_migrated_events) is self-contained: it builds the v0 database, patches to_event for one row, runs migrate(), and asserts both the destination contents and the log.
How often has this issue occurred?:
- Always (100%) whenever a row fails to convert
- 主要言語
- Python
- スター
- 21.6k
- フォーク
- 4k
- 平均マージ
- 12時間 6分
- マージ済み PR(30日)
- 4
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
google/adk-python#7292 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
google/adk-python#7289 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7282 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
CredentialsManager should also extract scopes when populating auth schemes対応中かも @sanketpatil06 が 3 日前に担当しました。 オープンcore needs review
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7266 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
OAuth2 Discovery method fails because FastMCP with GoogleProvider (OAuth) returns issuerUrl with trailing slash対応中かも @sanketpatil06 が 3 日前に担当しました。 オープンmcp
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/adk-python#7265 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
google/adk-python の issue をすべて見る
似ている issue
-
bug status/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
prowler-cloud/prowler#12887 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: desktop platform: macos priority: p3 status: ready type: enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
use-agent-os/agent-os#3484 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
open-telemetry/opentelemetry-python-contrib#5113 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/docs#6255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信