fix: retrieve the routing context to be derived from folders_map and …#749
fix: retrieve the routing context to be derived from folders_map and …#749UIPath-Harshit wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Data Fabric entity query routing to derive folder context from an entity→folder mapping (folders_map) rather than passing a QueryRoutingOverrideContext through the tool/subgraph layers, with added handling for resource overwrites.
Changes:
- Replace
QueryRoutingOverrideContextplumbing withfolders_map: dict[str, str]across the Data Fabric tool and subgraph. - Build
folders_mapfrom the configured entity set and apply resource overwrites when present. - Route Data Fabric record queries via an SDK entity client configured with the folder mapping.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/uipath_langchain/agent/tools/datafabric_tool/datafabric_tool.py |
Builds and passes folders_map into the Data Fabric query handler instead of a routing context. |
src/uipath_langchain/agent/tools/datafabric_tool/datafabric_subgraph.py |
Uses folders_map to configure the SDK entities client used for query execution. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae7fa98383
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/uipath_langchain/agent/tools/datafabric_tool/datafabric_tool.py
Outdated
Show resolved
Hide resolved
ae7fa98 to
452754f
Compare
…passing it through to SDK
452754f to
2c18432
Compare
Related PR : UiPath/uipath-python#1544
This pull request refactors the way folder context is managed for Data Fabric entity queries. Instead of passing a
QueryRoutingOverrideContextthroughout the code, the logic now builds and uses a direct mapping (folders_map) from entity names to folder IDs. This simplifies context handling, enables support for resource overwrites, and improves clarity in how folder resolution is performed.Refactoring of folder context handling:
Replaced all usage of
QueryRoutingOverrideContextwith afolders_map(dict[str, str]) throughout the Data Fabric subgraph and tool classes, updating constructors, method signatures, and internal logic accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9]Updated the helper function from
_build_routing_contextto_build_folders_map, which now constructs an entity-name-to-folder-ID map, applying resource overwrites when present. The docstring and implementation were revised to reflect this new behavior.Tool and handler creation updates:
DataFabricTextQueryHandlerand related classes to usefolders_mapinstead ofrouting_context, ensuring the new context handling flows throughout the toolchain.This refactor makes folder resolution more explicit and adaptable, especially in environments with resource overwrites.…passing it through to SDK