SQLite migration reports the source event count after skipping rows
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Bắt đầu với google/adk/sessions/migration/migrate_from_sqlalchemy_sqlite.py và so sánh hành vi đếm của nó với migrate_from_sqlalchemy_pickle.py. Chạy tests/unittests/sessions/migration/test_migration.py::test_sqlite_migration_reports_only_migrated_events; hoàn tất nghĩa là khi xảy ra lỗi chuyển đổi, đích chỉ còn các hàng thành công và nhật ký migration xác định chính xác các sự kiện đã được migration và bị bỏ qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🔴 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
- Ngôn ngữ chính
- Python
- Star
- 21.6k
- Fork
- 4k
- Merge trung bình
- 8 giờ 5 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
google/adk-python#7292 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
google/adk-python#7289 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7282 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
core needs review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7266 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/adk-python#7265 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của google/adk-python
Issue tương tự
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
benchmark-gap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày