Repository navigation
SWR pydata__xarray-10219 - #34
richeshgupta wants to merge 2 commits into
Conversation
| # TODO Refactor xarray upstream to avoid needing to overwrite this. | ||
| # TODO This copied version will drop all attrs - the keep_attrs stuff should be re-instated | ||
| if keep_attrs is None: | ||
| keep_attrs = _get_keep_attrs(default=False) |
There was a problem hiding this comment.
[MEDIUM] Global keep_attrs option is never tested with DatasetView.map()
Issue
map() now resolves keep_attrs=None through _get_keep_attrs(default=False), which respects the global keep_attrs option, but no test exercises this with xr.set_options(keep_attrs=True). Only the default resolution is covered, so a regression that ignores the global option would go undetected.
Evidence
CONFIRMED: the only new test, test_map_keep_attrs in xarray/tests/test_datatree.py, passes explicit keep_attrs=True or relies on the unset default; no test addition calls set_options. The removed TODO stating the copied version 'will drop all attrs' confirms keep_attrs support in map() is new in this PR, so no pre-existing test covers the global-option path.
SWRBench case pydata__xarray-10219: pinned base aa9e2bd to head daa73a5 of pydata#10219. Benchmark replay, not for merge.