Commit 2324c77
refactor(BA-5936): make CascadeChild generic over its row type
Parameterize CascadeChild on the cascade table's Row class
(``CascadeChild[TRow: Base]``) for consistency with PrunerSpec[TRow]
and to give subclass authors precise typing on ``row_class()`` —
e.g., ``CascadeChild[KernelRow]`` makes ``row_class()`` return
``type[KernelRow]`` instead of the over-broad ``type[Base]``.
PrunerSpec.cascade is typed as ``list[CascadeChild[Any]]`` since a
spec composes cascades over heterogeneous tables.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f23a963 commit 2324c77
2 files changed
Lines changed: 8 additions & 5 deletions
File tree
- src/ai/backend/manager/repositories/base
- tests/unit/manager/repositories/base
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | | - | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments