Skip to content

feat(data-fabric): align entity create field names with get response - #619

Merged
niket0503 merged 1 commit into
mainfrom
feat/align-entity-create-get-naming
Jul 27, 2026
Merged

feat(data-fabric): align entity create field names with get response#619
niket0503 merged 1 commit into
mainfrom
feat/align-entity-create-get-naming

Conversation

@niket0503

@niket0503 niket0503 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

The entity create request used different names than the get response for the same concepts. This aligns the create side to the get/API vocabulary — pure renames only, the flat/ergonomic create shape is unchanged.

Concept Before (create) After (create) Matches get
Field name fieldName name name
Remove-field name fieldName name name
Analytics flag isAnalyticsEnabled isInsightsEnabled isInsightsEnabled

Intentionally NOT changed

  • Flattened fields — scalar type + flat constraints (lengthLimit, maxValue…) and bare-id references (referenceEntityId/referenceFieldId) vs the nested fieldDataType/referenceEntity/referenceField in the response. These are deliberate create-input ergonomics; the SDK/backend bridge the gap (SDK maps typesqlType+fieldDisplayType; backend resolves reference ids to full objects on read).
  • folderKey vs folderIdfolderKey is the SDK-wide folder-scoping input used by every service; folderId is the entity's stored attribute in the response. Renaming would break cross-SDK consistency.

⚠️ Breaking change

Public create API renames: EntityCreateFieldOptions.fieldNamename, EntityRemoveFieldOptions.fieldNamename, EntityCreateOptions.isAnalyticsEnabledisInsightsEnabled.

CLI follow-up needed: the data-fabric-tool df entities create command validates fieldName and its examples use it — it needs a paired fieldNamename update when it bumps the SDK. (isAnalyticsEnabled isn't used by the CLI create.)

🤖 Generated with Claude Code

@niket0503
niket0503 marked this pull request as ready for review July 22, 2026 09:24
@niket0503
niket0503 requested a review from a team July 22, 2026 09:24
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from 8d5f422 to 8356b10 Compare July 22, 2026 15:54
Comment thread src/services/data-fabric/entities.ts Outdated
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review summary — 1 finding this run

  • entities.ts line 515 — The type cast correctly reads the wire field, but there is no unit test covering this path. A silent regression would disable analytics on every updateById call with no test failure. Requested: getById transform-completeness test for the new EntityMap entry, and an updateById analytics-preservation test.

@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from 8356b10 to ee8bd83 Compare July 22, 2026 16:13
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/services/data-fabric/entities.ts
@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from ee8bd83 to cc9c0f6 Compare July 22, 2026 16:57
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

/** Whether Analytics integration is enabled for this entity (default: false) */
isAnalyticsEnabled?: boolean;
/** Whether Insights integration is enabled for this entity (default: false). Matches the `isInsightsEnabled` field returned by `getById`. */
isInsightsEnabled?: boolean;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this. It was intentionally meant to be isAnalyticsEnabled.

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.

@vnaren23 We intentionally kept it as isAnalyticsEnabled But it is creating more confusion . Since Get API respond with isInsightsEnabled and create accept isAnalyticsEnabled. Instead of remapping the response of get Method , We felt if we can keep this flag same as isInsightsEnabled. Even in Python SDK we are exposing it as isInsightsEnabled only. Its is better to keep the source of truth same as API's unless necessary. Otherwise will cause more confusion if we keep it different for people using from coding agent/coded agent/coded app etc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is internal mapping. External contracts do not see the mapping we are doing. We intentionally took the route to keep external facing properties to be generic and not leak internal implementation details. I dont see a reason why we should revert this now.

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.

In that case get Response should also map it back to isAnalyticsEnabled right ? My concern is We can keep same naming convention for Create Method and Get Method.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming get response is already done.

@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from cc9c0f6 to 512be20 Compare July 23, 2026 14:59
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/models/data-fabric/entities.types.ts Outdated
@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from 512be20 to a63a9c9 Compare July 24, 2026 07:06
@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

The entity create request used different names than the get response for the
same concepts. Align the create side to the get/API vocabulary (pure renames —
the flat/ergonomic create shape is unchanged):

- EntityCreateFieldOptions.fieldName     -> name
- EntityRemoveFieldOptions.fieldName     -> name
- EntityCreateOptions.isAnalyticsEnabled -> isInsightsEnabled

Left as-is on purpose: the flattened fields (scalar `type` + flat constraints,
`referenceEntityId`/`referenceFieldId` vs nested objects) — intentional create
ergonomics; and `folderKey` (SDK-wide folder input, distinct from the
response's stored `folderId`).

BREAKING CHANGE: EntityCreateFieldOptions.fieldName and
EntityRemoveFieldOptions.fieldName are now `name`;
EntityCreateOptions.isAnalyticsEnabled is now isInsightsEnabled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niket0503
niket0503 force-pushed the feat/align-entity-create-get-naming branch from a63a9c9 to e25d607 Compare July 27, 2026 04:50
@claude

claude Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@sonarqubecloud

Copy link
Copy Markdown

@niket0503
niket0503 merged commit 4b5c47d into main Jul 27, 2026
16 checks passed
@niket0503
niket0503 deleted the feat/align-entity-create-get-naming branch July 27, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants