|
2 | 2 |
|
3 | 3 | from .alignment import align
|
4 | 4 | from .utils import Frozen, is_dict_like
|
5 |
| -from .variable import as_variable, default_index_coordinate |
| 5 | +from .variable import (as_variable, default_index_coordinate, |
| 6 | + assert_unique_multiindex_level_names) |
6 | 7 | from .pycompat import (basestring, OrderedDict)
|
7 | 8 |
|
8 | 9 |
|
@@ -110,7 +111,7 @@ def merge_variables(
|
110 | 111 | If provided, variables are always taken from this dict in preference to
|
111 | 112 | the input variable dictionaries, without checking for conflicts.
|
112 | 113 | compat : {'identical', 'equals', 'broadcast_equals', 'minimal'}, optional
|
113 |
| - Type of equality check to use wben checking for conflicts. |
| 114 | + Type of equality check to use when checking for conflicts. |
114 | 115 |
|
115 | 116 | Returns
|
116 | 117 | -------
|
@@ -278,6 +279,7 @@ def merge_coords_without_align(objs, priority_vars=None):
|
278 | 279 | """
|
279 | 280 | expanded = expand_variable_dicts(objs)
|
280 | 281 | variables = merge_variables(expanded, priority_vars)
|
| 282 | + assert_unique_multiindex_level_names(variables) |
281 | 283 | return variables
|
282 | 284 |
|
283 | 285 |
|
@@ -370,6 +372,7 @@ def merge_coords(objs, compat='minimal', join='outer', priority_arg=None,
|
370 | 372 | expanded = expand_variable_dicts(aligned)
|
371 | 373 | priority_vars = _get_priority_vars(aligned, priority_arg, compat=compat)
|
372 | 374 | variables = merge_variables(expanded, priority_vars, compat=compat)
|
| 375 | + assert_unique_multiindex_level_names(variables) |
373 | 376 |
|
374 | 377 | return variables
|
375 | 378 |
|
@@ -431,6 +434,7 @@ def merge_core(objs, compat='broadcast_equals', join='outer', priority_arg=None,
|
431 | 434 |
|
432 | 435 | priority_vars = _get_priority_vars(aligned, priority_arg, compat=compat)
|
433 | 436 | variables = merge_variables(expanded, priority_vars, compat=compat)
|
| 437 | + assert_unique_multiindex_level_names(variables) |
434 | 438 |
|
435 | 439 | dims = calculate_dimensions(variables)
|
436 | 440 |
|
|
0 commit comments