Commit fee2360
committed
Fix integer order_index step keys in native workflow loading
Galaxy `WorkflowContentsManager._workflow_to_dict_export()` serializes
workflow steps using the integer ``order_index`` as
the dict key (e.g. ``{0: {...}, 1: {...}}``), but
``NativeGalaxyWorkflow.steps`` is typed as ``dict[str, NativeStep]``.
Pydantic v2 does not coerce integer keys to strings, so
``NativeGalaxyWorkflow.model_validate()`` raised a ``ValidationError``
whenever ``load_native()`` / ``from_galaxy_native()`` was called on a
workflow dict produced directly by Galaxy (e.g. during export or
invocation download).
Fix: stringify every step key in ``_normalize_native_for_validation``
before the model is validated, so both lax and strict paths see string
keys (strict still rejects them because the coercion happens after the
strict-vs-lax branch).1 parent d53403a commit fee2360
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
| |||
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
130 | 157 | | |
131 | 158 | | |
132 | 159 | | |
| |||
0 commit comments