Spaces:
Build error
Build error
Update python/2_ancestors.py
Browse files- python/2_ancestors.py +1 -1
python/2_ancestors.py
CHANGED
@@ -77,7 +77,7 @@ ancestor_children_query = """
|
|
77 |
ac.depth + 1 -- Increment depth counter
|
78 |
FROM parent_level pl
|
79 |
JOIN ancestor_children_cte ac ON pl.base_tmp_id = ac.child_tmp_id
|
80 |
-
WHERE ac.depth <
|
81 |
)
|
82 |
SELECT
|
83 |
a.id AS ancestor,
|
|
|
77 |
ac.depth + 1 -- Increment depth counter
|
78 |
FROM parent_level pl
|
79 |
JOIN ancestor_children_cte ac ON pl.base_tmp_id = ac.child_tmp_id
|
80 |
+
WHERE ac.depth < 10 -- Limit recursion to 10 levels
|
81 |
)
|
82 |
SELECT
|
83 |
a.id AS ancestor,
|