Commit 8e51ce7
Fix Dataset.map to handle non-DataArray outputs
After PR pydata#10602, Dataset.map started failing when functions returned
non-DataArray values (e.g., scalars), raising AttributeError when
trying to access .coords on the returned values.
This restores backward compatibility by converting non-DataArray
outputs to DataArrays, which was the behavior before the regression.
Fixes pydata#10835
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 43a7f1e commit 8e51ce7
2 files changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6923 | 6923 | | |
6924 | 6924 | | |
6925 | 6925 | | |
| 6926 | + | |
| 6927 | + | |
6926 | 6928 | | |
6927 | 6929 | | |
6928 | 6930 | | |
6929 | 6931 | | |
6930 | 6932 | | |
6931 | 6933 | | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
| 6937 | + | |
| 6938 | + | |
6932 | 6939 | | |
6933 | 6940 | | |
6934 | 6941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6268 | 6268 | | |
6269 | 6269 | | |
6270 | 6270 | | |
| 6271 | + | |
| 6272 | + | |
| 6273 | + | |
| 6274 | + | |
| 6275 | + | |
| 6276 | + | |
| 6277 | + | |
| 6278 | + | |
| 6279 | + | |
| 6280 | + | |
| 6281 | + | |
| 6282 | + | |
| 6283 | + | |
| 6284 | + | |
| 6285 | + | |
| 6286 | + | |
| 6287 | + | |
| 6288 | + | |
| 6289 | + | |
| 6290 | + | |
| 6291 | + | |
| 6292 | + | |
| 6293 | + | |
| 6294 | + | |
| 6295 | + | |
6271 | 6296 | | |
6272 | 6297 | | |
6273 | 6298 | | |
| |||
0 commit comments