Skip to content

feat: expand Data Fabric entities service [DS-8360]#1616

Open
avichalsri24 wants to merge 3 commits intomainfrom
task/sync_entities_sdk
Open

feat: expand Data Fabric entities service [DS-8360]#1616
avichalsri24 wants to merge 3 commits intomainfrom
task/sync_entities_sdk

Conversation

@avichalsri24
Copy link
Copy Markdown

@avichalsri24 avichalsri24 commented May 7, 2026

Summary

Adds the missing Data Fabric methods on EntitiesService and exposes the full backend parameter set on existing batch methods.

New methods (sync + async):

  • Single-record ops: insert_record, get_record, update_record, delete_record — fire trigger events on each mutation.
  • query_records — structured query with filter_group, sort_options, selected_fields, expansions, expansion_level, aggregates, group_by, joins, binnings, start, limit. Routes to V2 endpoint when binnings is supplied.
  • Attachments: upload_attachment (bytes or path), download_attachment, delete_attachment.
  • Schema: create_entity (with full SQL-type mapping and per-type constraint defaults), delete_entity, update_entity_metadata.
  • import_records for CSV bulk upload.

Existing methods extended:

  • insert_records / update_records / delete_records accept expansion_level and fail_on_first.
  • list_records accepts OData filter / orderby / select / expand / expansion_level and returns EntityRecordsListResponse (a list subclass with total_count / has_next_page / next_cursor).

Bug fixes:

  • Batch operations recover per-record failures from HTTP 400 responses that carry successRecords / failureRecords lists; other non-2xx statuses propagate.
  • Record input is normalized — accepts dicts, Pydantic models, EntityRecord, or any object with __dict__.

Validation:
Client-side checks reject bad entity / field names (regex, length, reserved names) and per-field constraints (type compatibility, value ranges) before any HTTP call.

Backward compatibility:
Public method signatures only gained optional kwargs. EntityRecord.id stays required. list_records return type subclasses list, so iteration / indexing / len() / isinstance(records, list) continue to work.

Test plan

  • pytest packages/uipath-platform/tests/services/test_entities_service.py — 111 pass
  • pytest packages/uipath-platform/tests/ — 1157 pass
  • pytest packages/uipath/tests/ — 1840 pass
  • ruff check, ruff format --check, mypy src tests, lint_httpx_client.py — clean
  • Live smoke against a Data Fabric tenant before release tag

🤖 Generated with Claude Code

Add single-record operations (insert/get/update/delete), structured
query with filters/sort/expansions/aggregates/joins/binnings, file
attachments (upload/download/delete), entity schema management
(create/delete/update metadata), and CSV bulk import — sync and async
variants for each. Existing batch methods now accept expansion_level
and fail_on_first; list_records exposes OData filter/orderby/select/
expand and returns total_count / has_next_page / next_cursor.

Batch operations now recover per-record failures from HTTP 400
responses that carry successRecords/failureRecords lists, so callers
can handle unknown record ids gracefully instead of catching
exceptions.

Client-side validation rejects bad entity / field names (regex,
length, reserved names) and per-type constraints (range checks,
type-vs-constraint compatibility) before any HTTP call.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels May 7, 2026
@avichalsri24 avichalsri24 changed the title feat(platform): expand Data Fabric entities service [DS-8360] feat: expand Data Fabric entities service [DS-8360] May 7, 2026
avichalsri24 and others added 2 commits May 7, 2026 17:02
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 expands the Data Fabric EntitiesService surface area by adding missing Data Fabric entity operations (single-record CRUD, structured query, attachments, schema management, bulk import) and by exposing more backend parameters/metadata on existing batch and list endpoints.

Changes:

  • Added new Data Fabric APIs to EntitiesService: single-record CRUD, structured query (V1/V2 routing), attachments, entity schema create/update/delete, and CSV bulk import (sync + async).
  • Extended existing record list/batch operations to support additional backend parameters and richer pagination metadata (EntityRecordsListResponse), plus improved batch error recovery for per-record failures on HTTP 400.
  • Added/updated entity/query/schema models and comprehensive tests for the new behaviors.

Reviewed changes

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

Show a summary per file
File Description
packages/uipath/uv.lock Bumps editable uipath-platform version reference.
packages/uipath-platform/uv.lock Bumps uipath-platform version to 0.1.47.
packages/uipath-platform/pyproject.toml Version bump to 0.1.47.
packages/uipath-platform/src/uipath/platform/entities/entities.py Adds new response/query/schema models (batch failure shape, list response w/ metadata, structured query types).
packages/uipath-platform/src/uipath/platform/entities/_entities_service.py Implements the new/extended EntitiesService methods and request/response helpers.
packages/uipath-platform/src/uipath/platform/entities/init.py Exposes the newly added entities/query/schema symbols via package exports.
packages/uipath-platform/tests/services/test_entities_service.py Adds test coverage for new methods, query routing, attachments, schema creation defaults, and validation/error recovery.

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

Comment on lines +2494 to +2498
if isinstance(metadata, EntityMetadataUpdateOptions):
body = metadata.model_dump(by_alias=True, exclude_none=True)
else:
body = dict(metadata)
return RequestSpec(
"fields": [self._build_schema_field_payload(f) for f in fields],
"folderId": opts.folder_key or DATA_FABRIC_TENANT_FOLDER_ID,
"isRbacEnabled": bool(opts.is_rbac_enabled or False),
"isInsightsEnabled": bool(opts.is_analytics_enabled or False),
Comment on lines +546 to +548
def __getitem__(self, index: int) -> EntityRecord:
"""Index records by position (delegates to ``self.items``)."""
return self.items[index]
Comment on lines +553 to 556
) -> EntityRecordsListResponse:
"""Asynchronously list records from an entity with optional pagination and schema validation.

The schema parameter enables type-safe access to entity records by validating the
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