Skip to content

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

Open
niket0503 wants to merge 1 commit into
mainfrom
feat/datafabric-federated-entities
Open

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

Conversation

@niket0503

Copy link
Copy Markdown

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 on lines 1321 to 1323
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.*"
),
Comment on lines +51 to +55
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,
Comment on lines 14 to +19
EntityAggregate,
EntityAggregateFunction,
EntityBinning,
EntityClass,
EntityCreateExternalConnection,
EntityCreateExternalField,
@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
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 from 6d27906 to 740648a Compare August 12, 2026 13:58
…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>
@niket0503
niket0503 force-pushed the feat/datafabric-federated-entities branch from 740648a to ba36519 Compare August 12, 2026 14:10
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

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 →

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.

2 participants