Repository navigation
Commit 4ba89bd
authored
fix: adaptor map_names calls dict as function when inputs is a name-mapping dict (#8907)
**fix: adaptor map_names calls dict as function when inputs is a
name-mapping dict**
When `adaptor` wraps a function with `**kwargs` and `inputs` is a dict,
the `map_names` helper calls `input_map(k, k)` instead of
`input_map.get(k, k)`, raising `TypeError` before any data reaches the
wrapped function. The fix uses `input_map.get(k, k)` so the dict is
looked up rather than called, falling back to the original key when no
mapping exists.
### Types of changes
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [x] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
---------
Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>1 parent 5e42fbf commit 4ba89bd
2 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
0 commit comments