(self)
| 850 | assert_identical(old, new) |
| 851 | |
| 852 | def test_merge_auto_align(self): |
| 853 | ds1 = xr.Dataset({"a": ("x", [1, 2]), "x": [0, 1]}) |
| 854 | ds2 = xr.Dataset({"b": ("x", [3, 4]), "x": [1, 2]}) |
| 855 | expected = xr.Dataset( |
| 856 | {"a": ("x", [1, 2, np.nan]), "b": ("x", [np.nan, 3, 4])}, {"x": [0, 1, 2]} |
| 857 | ) |
| 858 | with set_options(use_new_combine_kwarg_defaults=False): |
| 859 | with pytest.warns( |
| 860 | FutureWarning, match="will change from join='outer' to join='exact'" |
| 861 | ): |
| 862 | assert expected.identical(ds1.merge(ds2)) |
| 863 | with pytest.warns( |
| 864 | FutureWarning, match="will change from join='outer' to join='exact'" |
| 865 | ): |
| 866 | assert expected.identical(ds2.merge(ds1)) |
| 867 | |
| 868 | with set_options(use_new_combine_kwarg_defaults=True): |
| 869 | with pytest.raises(ValueError, match="might be related to new default"): |
| 870 | expected.identical(ds2.merge(ds1)) |
| 871 | |
| 872 | |
| 873 | class TestMergeDataTree: |
nothing calls this directly
no test coverage detected