Migration module¶
The v1-to-v2 upgrade behind research-tracker migrate. See
Migration for the command and the backup
directory.
research_tracker.migrate.MigrationError
¶
Bases: RuntimeError
Raised when a store cannot be migrated rather than left half-rewritten.
Source code in src/research_tracker/migrate.py
33 34 | |
research_tracker.migrate.migrate_store(root, *, dry_run=False, backup=True, progress=None)
¶
Upgrade the schema-version-1 Parquet store at root to the SQLite backend.
Steps, in order: refuse anything that is not a v1 store; read and validate
every Parquet table; when backup is set move the Parquet files into
parquet-v1/; build and bulk-load a v2 store in a staging directory (so
ExperimentStore never sees the v1 marker at root); then publish the
database and the v2 marker; finally read the row counts back.
With dry_run the tables are read, validated, and loaded into the staging
store exactly as for a real run, and that staging store is then discarded,
so nothing under root is modified. Any failure while publishing restores
the Parquet files and the original marker, so a raised error never leaves a
partially-migrated store.
Source code in src/research_tracker/migrate.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
research_tracker.migrate.is_v1_store(root)
¶
True when root declares schema version 1 (the Parquet layout).
Source code in src/research_tracker/migrate.py
75 76 77 78 79 80 | |
research_tracker.migrate.is_v2_store(root)
¶
True when root is a complete schema-version-2 SQLite store.
Source code in src/research_tracker/migrate.py
83 84 85 86 87 88 89 90 91 92 | |