Skip to content

feat(platform): add Data Fabric error classification and extractor#1784

Open
UIPath-Harshit wants to merge 1 commit into
mainfrom
feat/datafabric-error-classification
Open

feat(platform): add Data Fabric error classification and extractor#1784
UIPath-Harshit wants to merge 1 commit into
mainfrom
feat/datafabric-error-classification

Conversation

@UIPath-Harshit

Copy link
Copy Markdown
Contributor

Summary

  • Adds DataFabricError dataclass and DataFabricErrorCategory enum that classifies DF query engine error codes into actionable categories: retryable, bad_sql, infrastructure, data_issue
  • Adds dedicated datafabric_ error payload extractor that parses {"error", "code", "traceId"} responses
  • Registers extractor in the service router so EnrichedException.error_info works for DF endpoints

Error code mapping is derived from the DF query engine server (QueryEngine/common/exceptions/ErrorCodes.java + ExceptionClassifier.java).

Companion PR: UiPath/uipath-langchain-python — adds OTEL span instrumentation that consumes this classification.

Test plan

  • Verify classify_error_code maps all known DF error codes correctly
  • Verify DataFabricError.from_enriched_exception extracts structured info from a DF 500
  • Verify extractor router routes datafabric_ URLs to the new extractor
  • Existing error/retry tests pass (uv run pytest -k "error or enriched or extractor")

🤖 Generated with Claude Code

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jul 2, 2026
@UIPath-Harshit UIPath-Harshit force-pushed the feat/datafabric-error-classification branch 3 times, most recently from bcffcf6 to 3e8f95c Compare July 2, 2026 06:47
@UIPath-Harshit UIPath-Harshit marked this pull request as ready for review July 2, 2026 06:48
Copilot AI review requested due to automatic review settings July 2, 2026 06:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds first-class Data Fabric (DF) error handling to uipath-platform by (1) classifying DF query-engine error codes into actionable categories and (2) integrating a DF-specific error payload extractor into the existing EnrichedException.error_info routing so callers can reliably extract message, error_code, and trace_id.

Changes:

  • Introduces DataFabricError + DataFabricErrorCategory and a DF error-code classifier/mapping.
  • Adds a dedicated datafabric_ extractor and registers it in the error-extractor router.
  • Annotates EntitiesService query methods with DF error-code metadata and adds tests for classification/extraction/routing.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/uipath-platform/tests/services/test_entities_service.py Adds a regression test ensuring DF query methods carry DF error-metadata attributes.
packages/uipath-platform/tests/errors/test_datafabric_errors.py Adds tests covering DF error code classification, DF payload extraction, and router behavior for datafabric_ URLs.
packages/uipath-platform/src/uipath/platform/errors/datafabric_error_codes.py Defines DF error code sets, DataFabricErrorCategory, and classify_error_code().
packages/uipath-platform/src/uipath/platform/errors/_extractors/_router.py Registers datafabric_ service prefix to route to the new DF extractor.
packages/uipath-platform/src/uipath/platform/errors/_extractors/_datafabric.py Implements DF payload extraction for {error, code, traceId} responses.
packages/uipath-platform/src/uipath/platform/errors/_datafabric_error.py Adds the structured DataFabricError model and metadata decorator for DF query methods.
packages/uipath-platform/src/uipath/platform/errors/init.py Exposes DataFabricError and DataFabricErrorCategory as public API exports.
packages/uipath-platform/src/uipath/platform/entities/_entities_service.py Applies DF error metadata decorator to entity query methods.
packages/uipath-platform/pyproject.toml Bumps package version to 0.1.90.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/uipath-platform/src/uipath/platform/errors/_datafabric_error.py Outdated

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

Copy link
Copy Markdown

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: 3e8f95c7e6

ℹ️ 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".

Comment thread packages/uipath-platform/src/uipath/platform/errors/_extractors/_datafabric.py Outdated
Map DF query-engine error codes to actionable categories (retryable,
bad_sql, infrastructure, data_issue) so callers can decide whether to
retry, fix SQL, or surface an infra error.

- Add datafabric_error_codes.py with code sets and classify_error_code
- Add DataFabricError dataclass with from_enriched_exception / from_response_body
- Add extract_datafabric extractor and wire it into the error router
- Add attach_datafabric_error_mapping decorator on query_entity_records
- Add comprehensive test suite for all new modules
- Bump uipath-platform version to 0.1.90

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@UIPath-Harshit UIPath-Harshit force-pushed the feat/datafabric-error-classification branch from 3e8f95c to b09f6a0 Compare July 2, 2026 09:18
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants