Skip to content

Commit 04fcd30

Browse files
fix remap_vars unit test
1 parent 6ddea8c commit 04fcd30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/unit/core/rewrite/test_identifiers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,13 @@ def test_remap_variables_concat_self_stability(leaf):
134134

135135
def test_remap_variables_in_node_converts_dag_to_tree(leaf, leaf_too):
136136
# Create an InNode with the same child twice, should create a tree from a DAG
137+
right = nodes.SelectionNode(
138+
leaf_too, (nodes.AliasedRef.identity(identifiers.ColumnId("col_a")),)
139+
)
137140
node = nodes.InNode(
138141
left_child=leaf,
139-
right_child=leaf_too,
142+
right_child=right,
140143
left_col=ex.DerefOp(identifiers.ColumnId("col_a")),
141-
right_col=ex.DerefOp(identifiers.ColumnId("col_a")),
142144
indicator_col=identifiers.ColumnId("indicator"),
143145
)
144146

@@ -147,7 +149,5 @@ def test_remap_variables_in_node_converts_dag_to_tree(leaf, leaf_too):
147149
new_node = typing.cast(nodes.InNode, new_node)
148150

149151
left_col_id = new_node.left_col.id.name
150-
right_col_id = new_node.right_col.id.name
152+
new_node.validate_tree()
151153
assert left_col_id.startswith("id_")
152-
assert right_col_id.startswith("id_")
153-
assert left_col_id != right_col_id

0 commit comments

Comments
 (0)