feat(entities): migrate Data Fabric entities to v3 APIs + federated create - #1857
feat(entities): migrate Data Fabric entities to v3 APIs + federated create#1857niket0503 wants to merge 1 commit into
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.
| url=re.compile( | ||
| rf"{base_url}{org}{tenant}/datafabric_/api/EntityService/entity/{entity_key}/query.*" | ||
| rf"{base_url}{org}{tenant}/datafabric_/api/v3/entities/entity/{entity_key}/query.*" | ||
| ), |
| class DataDirectionType(IntEnum): | ||
| """Data direction for an external field mapping. | ||
|
|
||
| ReadOnly = "ReadOnly" | ||
| ReadAndWrite = "ReadAndWrite" | ||
| Numeric on the wire — the string form (e.g. ``"ReadOnly"``) is rejected by | ||
| the v3 create/upsert endpoint with a 500. ``ReadOnly`` is read-only, |
| EntityAggregate, | ||
| EntityAggregateFunction, | ||
| EntityBinning, | ||
| EntityClass, | ||
| EntityCreateExternalConnection, | ||
| EntityCreateExternalField, |
7448758 to
6d27906
Compare
|
Addressed the Copilot review + version bump:
Full |
6d27906 to
740648a
Compare
…reate
Ports the TypeScript SDK's v3 migration and federated-entity support to Python.
- create_entity -> v3 upsert (POST /api/v3/entities); supports federated entities
via 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_metadata -> v3.
retrieve_by_name and choice-set listing stay v1 (no matching v3 response shape).
- record CRUD (list/get/insert/update/delete + batches) -> v3
(/api/v3/entities/entity/{id}/...).
- query routing: joins stay on v1 by-key (the v3 by-id query rejects joins);
everything else, including binnings, uses the v3 by-id query so federated
entities are readable (binning gated by the same EnableBinningOnQuery flag the
v2 path used).
- new models: EntityClass/EntityClassId, numeric DataDirectionType,
JoinType.InnerJoin, Searchability*, EntityCreateExternal{Connection,Object,
FieldMapping,Field,Source}, NativeConnectionDetail, SourceJoinConditionDetail;
all exported from uipath.platform.entities. DataDirectionType still accepts the
legacy string member names as input (back-compat) while serializing numeric.
Bumps uipath-platform 0.2.12 -> 0.2.13. Tests updated to v3 URLs, plus new
federated-create, binning->v3, join->v1 routing, and DataDirectionType back-compat
tests. Full uipath-platform suite passes; mypy and ruff clean. Validated live
against alpha (native v3 round-trip + federated Salesforce create/query).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
740648a to
ba36519
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