Closed 345ishaan closed 1 month ago
Hello @345ishaan! 👋 I'm Dosu, a bot here to assist you with bug fixes, answer your questions, and help you contribute effectively while we await a human maintainer. I'm diving into your issue about the CodeHierarchyQuery Engine doing redundant operations and not finding hierarchical nodes. I'll get back to you with a comprehensive response shortly!
Feel free to make a pr @345ishaan 👍
Feel free to make a pr @345ishaan 👍
I have created a PR here: https://github.com/run-llama/llama_index/pull/12983 but I think the current behavior is correct and we should remove the unncessary DFS logic.
Maybe the owner of the this llama-pack can shed some light on what was the reason for doing this.
It looks like you've already taken the right steps by creating a PR and seeking further clarification on the necessity of the current logic. Since @logan-markewich has encouraged you to make a PR and you're looking for more insight into the design decisions, it would be best for the owner of the llama-pack or @logan-markewich to provide further details on why the redundant DFS logic was initially implemented. This will help ensure that any changes made align with the overall design and functionality goals of the project.
To continue the conversation, mention @dosu.
Bug Description
The following lines of code are redundant: https://github.com/run-llama/llama_index/blob/954398e1957027a364d0d332fee61733ad322f8b/llama-index-packs/llama-index-packs-code-hierarchy/llama_index/packs/code_hierarchy/query_engine.py#L116-L121
1) We are doing DFS to find all kvs from the root_map 2) Then we are again doing DFS to find if there is any exact match.
Instead the kvs should be made from self.node_dict and DFS should be happening on the self.root_map
cc @logan-markewich
Version
Latest
Steps to Reproduce
NA
Relevant Logs/Tracbacks
No response