Skip to content

fix: retrieve the routing context to be derived from folders_map and …#749

Open
UIPath-Harshit wants to merge 1 commit intomainfrom
fix/entity-as-resource-overwrite
Open

fix: retrieve the routing context to be derived from folders_map and …#749
UIPath-Harshit wants to merge 1 commit intomainfrom
fix/entity-as-resource-overwrite

Conversation

@UIPath-Harshit
Copy link
Copy Markdown

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 QueryRoutingOverrideContext throughout 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 QueryRoutingOverrideContext with a folders_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_context to _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:

  • Modified the creation and initialization of DataFabricTextQueryHandler and related classes to use folders_map instead of routing_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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 QueryRoutingOverrideContext plumbing with folders_map: dict[str, str] across the Data Fabric tool and subgraph.
  • Build folders_map from 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@UIPath-Harshit UIPath-Harshit force-pushed the fix/entity-as-resource-overwrite branch from ae7fa98 to 452754f Compare April 6, 2026 11:31
@UIPath-Harshit UIPath-Harshit force-pushed the fix/entity-as-resource-overwrite branch from 452754f to 2c18432 Compare April 6, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants