skrawcz commented on code in PR #1483:
URL: https://github.com/apache/hamilton/pull/1483#discussion_r2815402798


##########
tests/test_graph.py:
##########
@@ -1478,3 +1480,41 @@ def test_display_name_list_value_uses_first_element():
     assert "First Name" in dot_string
     # The function name should NOT appear since display_name is set
     assert "<b>node_with_list_display_name</b>" not in dot_string
+
+
+def test_get_upstream_nodes_large_chain_no_recursion_error():
+    """Regression test: get_upstream_nodes with only final_node on a large 
chain DAG.
+
+    A recursive DFS would exceed Python's recursion limit (~1000) when 
traversing
+    a long dependency chain from a single final node. This test verifies that
+    the iterative DFS in directional_dfs_traverse handles large DAGs correctly.
+
+    Chain size is chosen to exceed recursion limit: 1200 nodes > 1000.
+    """
+    from hamilton import ad_hoc_utils
+    from hamilton import function_modifiers as fm

Review Comment:
   need to move these out



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to