feat(entities): migrate Data Fabric entities to v3 APIs + federated create - #1857
Conversation
There was a problem hiding this comment.
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
EntityClassIdis not listed in__all__, so it still won't be exported when users dofrom uipath.platform.entities import *and tooling that relies on__all__won't see it. Add it alongsideEntityClass.
"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_v1suggests it exercises the v1 path. Renaming it to..._v3will 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.
7448758 to
6d27906
Compare
|
Addressed the Copilot review + version bump:
Full |
740648a to
ba36519
Compare
6f84774 to
81fc6db
Compare
…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>
81fc6db to
79ecd92
Compare
|
🚨 Heads up:
|



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_entitynow targets the v3 upsert (POST /api/v3/entities) and supports federated entities:EntityCreateOptions.entity_class=Federatedwithexternal_fields(connector or native sources) andsource_join_condition_details. Validates the class (rejectsCase) and requires ≥1 source forFederated.retrieve,list_entities,delete_entity,update_entity_metadata→ v3.list_entitiesnow includes federated entities (the v1 list excludes them).retrieve_by_nameand choice-set listing stay on v1 — the v3 by-name route returns a different (CompositeEntityMetadataResponse) shape, and choice-set listing is unchanged.Records:
/api/v3/entities/entity/{id}/…), same HTTP methods/bodies.EnableBinningOnQueryfeature flag the old v2 path used (confirmed in the backend), so the special v2 path was dropped.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, numericDataDirectionType,JoinType.InnerJoin,Searchability/SearchabilityOperator/SearchabilityNamedSearch,EntityCreateExternalConnection/EntityCreateExternalObject/EntityCreateExternalFieldMapping/EntityCreateExternalField/EntityCreateExternalSource,NativeConnectionDetail,SourceJoinConditionDetail;EntityCreateOptionsgainsentity_class,external_fields,source_join_condition_details.Testing
uipath-platformsuite passes;mypyandruffclean. Added federated-create, binning→v3, and join→v1 routing tests; migrated existing mocks to v3.Accountcreate + live query round-trip through the SDK.🤖 Generated with Claude Code