Skip to content

Commit dac79dd

Browse files
committed
test(concat): update layer-key assertions for X-as-None layer post #1707
#1707 (feat!: Unify X and layers) moved X into the layers mapping under the `None` key. Two aligned_axis_key_join layer-key tests asserted `sorted(res.layers.keys())` against named keys only, which now fails with TypeError when None is present. Switched to set comparison and explicitly included the `None` (X) key in both the outer-union and inner-intersection expectations.
1 parent 181318f commit dac79dd

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

tests/test_concatenate.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,12 +2018,14 @@ def test_aligned_axis_key_join_layer_keys_unioned_with_inner_content():
20182018

20192019
res = concat([a, b], join="inner", aligned_axis_key_join="outer")
20202020

2021-
# Outer key join: every layer name appears.
2022-
assert sorted(res.layers.keys()) == [
2021+
# Outer key join: every layer name appears. Post #1707, X is stored
2022+
# under the `None` layer key, so it shows up here too.
2023+
assert set(res.layers.keys()) == {
2024+
None,
20232025
"only_a_layer",
20242026
"only_b_layer",
20252027
"shared_layer",
2026-
]
2028+
}
20272029

20282030
# Inner content join: alt-axis (var) is the intersection {v1, v2}.
20292031
n_total_cells = 4
@@ -2075,8 +2077,10 @@ def test_aligned_axis_key_join_layer_keys_intersected_with_outer_content():
20752077

20762078
res = concat([a, b], join="outer", aligned_axis_key_join="inner")
20772079

2078-
# Inner key join: only the layer present in every input survives.
2079-
assert sorted(res.layers.keys()) == ["shared_layer"]
2080+
# Inner key join: only the layer keys present in every input survive.
2081+
# Post #1707, X is stored under the `None` layer key and is present in
2082+
# both inputs, so it survives the intersection alongside "shared_layer".
2083+
assert set(res.layers.keys()) == {None, "shared_layer"}
20802084

20812085
# Outer content join: alt-axis (var) is the union {v1, v2, v3}.
20822086
n_total_cells = 4

0 commit comments

Comments
 (0)