Skip to content

Fix node column resolution for role playing dimensions#2331

Merged
israelhill merged 1 commit into
mainfrom
partition-role-playing-dim-fix
Jul 14, 2026
Merged

Fix node column resolution for role playing dimensions#2331
israelhill merged 1 commit into
mainfrom
partition-role-playing-dim-fix

Conversation

@israelhill

Copy link
Copy Markdown
Contributor

Fix role-playing dimension column resolution in column-scoped endpoints

Problem

get_node_column — the shared resolver behind the set-partition, remove-partition, and set-attributes endpoints — resolves columns strictly by bare name, with no awareness of the role suffix (dimension_column). For a node with two columns sharing a bare name but different roles (e.g. a date dim reached via two FKs), this caused two bugs:

  • Silent wrong-column: a bare-name request bound the operation to whichever role sorted last in a dict comprehension — no error, silently corrupting materialization config.
  • Can't target a role: a role-qualified name (…dateint[epoch_date]) matched nothing → 404, so there was no way to pin the operation to a specific role.

Surfaced on cube arc.content_migration.cade_batch_funnel, where a UI materialize intending [epoch_date] silently landed the partition on [region_date].

Fix

Resolve by the role-qualified identity (name + dimension_column) first, fall back to bare name only when unambiguous, and raise a 422 listing the role-qualified options when a bare name is ambiguous — instead of silently picking one. Fixing the shared resolver fixes set-partition, remove-partition, and set-attributes at once. No endpoint signature or client changes.

Tests

  • Unit (get_node_column): role-qualified resolves to the right role; ambiguous bare name raises listing both options; unique bare name still works; unknown column still 404s with the original message.
  • API: role-qualified POST/DELETE …/partition targets one role without touching the other; bare ambiguous POST returns 422 and sets nothing.
  • Existing partition/attributes/materialize tests still pass (backward compat)

@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 43a197a
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a5665d41696cb0008ce04e9

@shangyian shangyian left a comment

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.

Nice catch, thanks!

@israelhill
israelhill merged commit 9ece8f9 into main Jul 14, 2026
21 checks passed
@israelhill
israelhill deleted the partition-role-playing-dim-fix branch July 14, 2026 17:28
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.

2 participants