SQLite migration reports the source event count after skipping rows
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 88/100
Rechercherichtung
Beginne mit google/adk/sessions/migration/migrate_from_sqlalchemy_sqlite.py und vergleiche dessen Zählverhalten mit migrate_from_sqlalchemy_pickle.py. Führe tests/unittests/sessions/migration/test_migration.py::test_sqlite_migration_reports_only_migrated_events aus; erledigt bedeutet, dass ein Konvertierungsfehler dazu führt, dass das Ziel nur erfolgreiche Zeilen enthält und das Migrationsprotokoll die migrierten und übersprungenen Ereignisse korrekt identifiziert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🔴 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
- Vorherrschende Sprache
- Python
- Sterne
- 21.6k
- Forks
- 4k
- Ø Merge
- 8 Std. 5 Min.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/adk-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
google/adk-python#7292 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
google/adk-python#7289 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
google/adk-python#7282 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
core needs review
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
google/adk-python#7266 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
mcp
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
google/adk-python#7265 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in google/adk-python
Ähnliche Issues
-
correction metadata
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
acl-org/acl-anthology#10104 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug status/needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
prowler-cloud/prowler#12885 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceOffenbug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
selimfirat/pysad#107 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug ci-failure high priority
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vllm-project/vllm-omni#8194 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag