SQLite migration reports the source event count after skipping rows
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 88/100
Direção de pesquisa
Comece com google/adk/sessions/migration/migrate_from_sqlalchemy_sqlite.py e compare seu comportamento de contagem com migrate_from_sqlalchemy_pickle.py. Execute tests/unittests/sessions/migration/test_migration.py::test_sqlite_migration_reports_only_migrated_events; considera-se concluído quando uma falha de conversão deixa no destino apenas as linhas convertidas com sucesso e o log de migração identifica corretamente os eventos migrados e ignorados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
🔴 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
- Linguagem predominante
- Python
- Estrelas
- 21.6k
- Forks
- 4k
- Merge médio
- 12h 6min
- PRs com merge (30d)
- 4
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de google/adk-python
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
google/adk-python#7292 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
google/adk-python#7289 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
google/adk-python#7282 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
CredentialsManager should also extract scopes when populating auth schemesTalvez já em andamento @sanketpatil06 assumiu há 2 dias. Abertacore needs review
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
google/adk-python#7266 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
OAuth2 Discovery method fails because FastMCP with GoogleProvider (OAuth) returns issuerUrl with trailing slashTalvez já em andamento @sanketpatil06 assumiu há 2 dias. Abertamcp
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
google/adk-python#7265 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de google/adk-python
Issues semelhantes
-
Broken links found in docsAbertadocs pydanty:is-working
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
pydantic/pydantic-ai#8863 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
run-llama/llama_index#23278 ·
Mantenedores costumam responder em até 2 dias
-
documentation from-review-extraction github-actions priority: low severity:nit
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
LearningCircuit/local-deep-research#6946 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
oracle/langchain-oracle#323 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
tenstorrent/tt-metal#58057 · 1 comentário ·
Mantenedores costumam responder em até 1 dia