(self)
| 810 | assert_identical(old, new) |
| 811 | |
| 812 | def test_merge(self): |
| 813 | data = create_test_data() |
| 814 | ds1 = data[["var1"]] |
| 815 | ds2 = data[["var3"]] |
| 816 | expected = data[["var1", "var3"]] |
| 817 | with set_options(use_new_combine_kwarg_defaults=True): |
| 818 | actual = ds1.merge(ds2) |
| 819 | assert_identical(expected, actual) |
| 820 | |
| 821 | actual = ds2.merge(ds1) |
| 822 | assert_identical(expected, actual) |
| 823 | |
| 824 | actual = data.merge(data) |
| 825 | assert_identical(data, actual) |
| 826 | |
| 827 | ds1.merge(ds2.rename({"var3": "var1"})) |
| 828 | |
| 829 | with pytest.raises(ValueError, match=r"should be coordinates or not"): |
| 830 | data.reset_coords().merge(data) |
| 831 | with pytest.raises(ValueError, match=r"should be coordinates or not"): |
| 832 | data.merge(data.reset_coords()) |
| 833 | |
| 834 | def test_merge_broadcast_equals(self): |
| 835 | ds1 = xr.Dataset({"x": 0}) |
nothing calls this directly
no test coverage detected