Skip to content

feat(entities): migrate Data Fabric entities to v3 APIs + federated create - #1857

Merged
niket0503 merged 1 commit into
mainfrom
feat/datafabric-federated-entities
Sep 3, 2026
Merged

feat(entities): migrate Data Fabric entities to v3 APIs + federated create#1857
niket0503 merged 1 commit into
mainfrom
feat/datafabric-federated-entities

Conversation

@niket0503

Copy link
Copy Markdown
Contributor

Ports the TypeScript SDK's Data Fabric changes (uipath-typescript — v3 migration + federated entity support) to the Python SDK (uipath-platform).

What changed

Entity schema (create / reads):

  • create_entity now targets the v3 upsert (POST /api/v3/entities) and supports federated entities: EntityCreateOptions.entity_class=Federated with external_fields (connector or native sources) and source_join_condition_details. Validates the class (rejects Case) and requires ≥1 source for Federated.
  • retrieve, list_entities, delete_entity, update_entity_metadatav3. list_entities now includes federated entities (the v1 list excludes them).
  • retrieve_by_name and choice-set listing stay on v1 — the v3 by-name route returns a different (CompositeEntityMetadataResponse) shape, and choice-set listing is unchanged.

Records:

  • Record CRUD (list/get/insert/update/delete + batches) → v3 (/api/v3/entities/entity/{id}/…), same HTTP methods/bodies.
  • Query routing: joins stay on the v1 by-key endpoint (the v3 by-id query rejects joins); everything else — including binnings — uses the v3 by-id query, so federated entities are readable. Binning is gated by the same EnableBinningOnQuery feature flag the old v2 path used (confirmed in the backend), so the special v2 path was dropped.
  • The federated SQL passthrough (query_entity_records/api/v1/query/execute) is unchanged — it's the query-engine's own endpoint, not part of the entity v1→v3 surface.

New models (exported from uipath.platform.entities): EntityClass/EntityClassId, numeric DataDirectionType, JoinType.InnerJoin, Searchability/SearchabilityOperator/SearchabilityNamedSearch, EntityCreateExternalConnection/EntityCreateExternalObject/EntityCreateExternalFieldMapping/EntityCreateExternalField/EntityCreateExternalSource, NativeConnectionDetail, SourceJoinConditionDetail; EntityCreateOptions gains entity_class, external_fields, source_join_condition_details.

Note: the TS updateById (federated/native field deltas) is intentionally not ported in this PR — scoped to create + reads + query.

Testing

  • Full uipath-platform suite passes; mypy and ruff clean. Added federated-create, binning→v3, and join→v1 routing tests; migrated existing mocks to v3.
  • Validated live against alpha: native v3 round-trip (create→insert→query→list→delete) and a federated Salesforce Account create + live query round-trip through the SDK.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 12, 2026 12:02
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Aug 12, 2026

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 ports Data Fabric entity and record operations in uipath-platform to the v3 API surface and adds federated entity create support, aligning the Python SDK with the TypeScript SDK’s Data Fabric updates.

Changes:

  • Migrates entity schema operations (retrieve/list/create/delete/metadata update) to datafabric_/api/v3/entities, including v3 upsert-based create with federated entity payload support.
  • Migrates record CRUD + batch endpoints to the v3 entity data endpoints, and updates query routing to use v3 by-id except when joins are present (joins route to the v1 by-key endpoint).
  • Introduces new federated-create models/enums and expands the test suite/mocks to validate v3 routing and federated payload shapes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/uipath-platform/tests/services/test_entities_service.py Updates mocks/assertions to v3 endpoints; adds tests for federated create payload and query routing (binnings → v3, joins → v1).
packages/uipath-platform/src/uipath/platform/entities/entities.py Adds federated-create models and enums; changes DataDirectionType to numeric wire representation; adds EntityClass and related mapping.
packages/uipath-platform/src/uipath/platform/entities/_entity_schema_service.py Routes entity schema operations to v3; builds federated create/upsert payload including external sources and join-condition details.
packages/uipath-platform/src/uipath/platform/entities/_entity_data_service.py Migrates record endpoints to v3 and updates structured query routing logic (joins → v1, otherwise → v3).
packages/uipath-platform/src/uipath/platform/entities/init.py Re-exports new models/enums from uipath.platform.entities (with a noted missing export).
Suppressed comments (2)

packages/uipath-platform/src/uipath/platform/entities/init.py:71

  • EntityClassId is not listed in __all__, so it still won't be exported when users do from uipath.platform.entities import * and tooling that relies on __all__ won't see it. Add it alongside EntityClass.
    "Entity",
    "EntityAggregate",
    "EntityAggregateFunction",
    "EntityBinning",
    "EntityClass",
    "EntityCreateExternalConnection",

packages/uipath-platform/tests/services/test_entities_service.py:2366

  • This async test now uses the v3 query endpoint, but the name test_query_async_v1 suggests it exercises the v1 path. Renaming it to ..._v3 will keep the intent clear (especially now that joins intentionally route to v1).
            url=re.compile(
                rf"{base_url}{org}{tenant}/datafabric_/api/v3/entities/entity/{entity_key}/query"
            ),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/uipath-platform/tests/services/test_entities_service.py
Comment thread packages/uipath-platform/src/uipath/platform/entities/entities.py
Comment thread packages/uipath-platform/src/uipath/platform/entities/__init__.py
@niket0503
niket0503 force-pushed the feat/datafabric-federated-entities branch from 7448758 to 6d27906 Compare August 12, 2026 12:35
@niket0503

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review + version bump:

  • Test names — renamed test_query_v1_with_filter_and_paginationtest_query_v3_by_id_with_filter_and_pagination and test_query_async_v1test_query_async_v3_by_id to match the endpoint under test. (test_query_with_joins_routes_to_v1 stays — it genuinely asserts the v1 by-key join route.)
  • DataDirectionType back-compat — added _missing_ so the legacy string member names ("ReadOnly" / "ReadAndWrite", case-insensitive) are still accepted as input and normalise to the numeric members, while serializing the numeric wire form. Added a test locking this.
  • EntityClassId export — added to __init__.py imports + __all__.
  • Version bumpuipath-platform 0.2.120.2.13 (patch; matches the pattern of prior entities feature PRs and satisfies the dependency-bump check). No uipath bump needed — its uipath-platform>=0.2.4, <0.3.0 range still holds.

Full uipath-platform suite green, mypy/ruff clean (161 entity tests).

@niket0503
niket0503 force-pushed the feat/datafabric-federated-entities branch 2 times, most recently from 740648a to ba36519 Compare August 12, 2026 14:10
@niket0503
niket0503 force-pushed the feat/datafabric-federated-entities branch 6 times, most recently from 6f84774 to 81fc6db Compare September 3, 2026 09:03
…d v1

Keep the existing entity methods on the legacy v1
datafabric_/api/Entity / EntityService surfaces (marked @deprecated) and
add parallel experimental *_v3 methods targeting datafabric_/api/v3/entities.
Only the v3 surface serves Federated entities; create_entity_v3 accepts
entityClassId / externalFields / sourceJoinConditionDetails for Federated
creates. Internal spec/service layers are parametrized with use_v3 (v1 default);
the public split (X deprecated + X_v3 experimental) lives on EntitiesService.

FQS query/execute and choice-set listing stay on v1 (no v3 equivalent).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niket0503
niket0503 force-pushed the feat/datafabric-federated-entities branch from 81fc6db to 79ecd92 Compare September 3, 2026 12:05
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@niket0503
niket0503 merged commit 333ce46 into main Sep 3, 2026
174 of 177 checks passed
@niket0503
niket0503 deleted the feat/datafabric-federated-entities branch September 3, 2026 12:20
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.

4 participants