Commit 3218cd1
feat: Add migration utilities and fix flaky job tests (#1332)
* feat: add Phase 2 migration functions for column type and blob markers
Add migrate_columns() and supporting functions for Phase 2 of the
0.14.6 → 2.0 migration:
- analyze_columns(): Identify columns needing type labels
- migrate_columns(): Add core type markers to column comments
- NATIVE_TO_CORE_TYPE mapping for type conversion
- Support for bool/datetime special cases
- Dry-run mode for previewing changes
Also adds placeholder stubs for Phase 3-4 migration functions:
- migrate_external(): For external storage migration
- migrate_filepath(): For filepath attribute migration
- finalize_migration(): For Phase 4 finalization
These functions implement the migration guide documented in
datajoint-docs/src/how-to/migrate-from-0x.md.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: resolve flaky tests by using delay=-1 for immediate job scheduling
The tests test_sigint, test_sigterm, test_suppress_dj_errors, and
test_populate_exclude_error_and_ignore_jobs were flaky due to a race
condition: jobs created with scheduled_time=NOW(3) might not pass the
scheduled_time <= NOW(3) check if checked in the same millisecond.
Fix by using delay=-1 in auto-refresh during populate(), ensuring jobs
are scheduled 1 second in the past and immediately schedulable.
Also update test_populate_exclude_error_and_ignore_jobs to use delay=-1
in its explicit refresh() call.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: address PR #1311 review comments
- Replace bare except: with except ImportError: in diagram.py
- Replace assert statements with explicit raises in blob.py
- Replace assert False with explicit raises in expression.py and declare.py
- Implement hash verification in objectref.py
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: remove deprecated dj.key from __all__
dj.key was removed in 2.0 but was still listed in __all__ without
being imported or defined.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: remove deprecated dj.schema and dj.Di aliases
- Remove `schema` alias for `Schema` (use `dj.Schema` instead of `dj.schema`)
- Remove `Di` alias for `Diagram` (use `dj.Diagram` or `dj.ERD`)
- Update all examples, tests, and docstrings
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* docs: fix broken documentation links
Update outdated docs.datajoint.com URLs to new paths:
- diagram.py: /how-to/installation/
- heading.py: /how-to/migrate-from-0x/
- expression.py: /how-to/migrate-from-0x/
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* chore: bump version to 2.0.0a19
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: remove deprecated dj.key_hash and dj.Di
- Remove key_hash function (legacy job table debugging)
- Remove hash.py module
- Fix test_erd.py to use dj.Diagram instead of dj.Di
- Bump version to 2.0.0a20
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* fix: remove deprecated dj.ERD alias
- Remove ERD alias (use dj.Diagram)
- Rename test_erd_algebra to test_diagram_algebra
- Remove test_diagram_aliases test
- Bump version to 2.0.0a21
Co-Authored-By: Claude Opus 4.5 <[email protected]>
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent 471b8a9 commit 3218cd1
File tree
19 files changed
+672
-85
lines changed- src/datajoint
- tests
- integration
- unit
19 files changed
+672
-85
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
| |||
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | | - | |
60 | | - | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
84 | | - | |
85 | 79 | | |
86 | 80 | | |
87 | 81 | | |
| |||
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
93 | | - | |
94 | | - | |
95 | 87 | | |
96 | 88 | | |
97 | 89 | | |
| |||
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
104 | | - | |
105 | | - | |
106 | 96 | | |
107 | 97 | | |
108 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | | - | |
| 367 | + | |
| 368 | + | |
367 | 369 | | |
368 | 370 | | |
369 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | | - | |
1089 | | - | |
| 1088 | + | |
| 1089 | + | |
1090 | 1090 | | |
1091 | 1091 | | |
1092 | | - | |
1093 | | - | |
| 1092 | + | |
| 1093 | + | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
470 | | - | |
| 469 | + | |
| 470 | + | |
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| |||
0 commit comments