SQLite migration reports the source event count after skipping rows
維護者通常 5 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 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;完成的標準是,轉換失敗時目的地只保留成功的資料列,且 migration log 能準確識別已遷移和已略過的事件。
由索引模型根據 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 分鐘
- 30 天內合併 PR
- 4
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
google/adk-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
google/adk-python#7341 · 2 個 reaction ·
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
google/adk-python#7334 · 2 則留言 · 已指派 1 人 ·
維護者通常 5 天內回覆
-
GoogleOidcVerifier treats string "false" as a verified email claim可能已有人在做 @surajksharma07 於 2 天前認領。 未關閉core
難度 2/5 1-3 小時 新手友好度 82/100
google/adk-python#7289 · 5 則留言 · 已指派 1 人 ·
維護者通常 5 天內回覆
-
RestApiTool raises uncaught KeyError when a required path param is omitted可能已有人在做 @llalitkumarrr 於 2 天前認領。 未關閉request clarification tools
難度 2/5 1-3 小時 新手友好度 78/100
google/adk-python#7282 · 3 則留言 · 已指派 1 人 ·
維護者通常 5 天內回覆
-
CredentialsManager should also extract scopes when populating auth schemes可能已有人在做 @sanketpatil06 於 5 天前認領。 未關閉core needs review
難度 2/5 1-3 小時 新手友好度 78/100
google/adk-python#7266 · 2 則留言 · 已指派 1 人 ·
維護者通常 5 天內回覆
查看 google/adk-python 的全部 Issue
相似的 Issue
-
namespace operations
難度 1/5 1 小時以內 新手友好度 82/100
EclipseFdn/open-vsx.org#13573 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
collective/icalendar#1854 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
rancher/rancher-ai-agent#412 ·
維護者通常 6 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
TUDelftGeodesy/DePSI#134 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
HenriquesLab/rxiv-maker#335 ·