Skip to content

Fix cube crash when requesting columns#2041

Merged
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:cube-cols-gql
Apr 21, 2026
Merged

Fix cube crash when requesting columns#2041
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:cube-cols-gql

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Apr 21, 2026

Summary

Querying a cube for both columns { displayName } and cubeMetrics { name } (or cubeDimensions { name }) crashed with '_RawColumn' object has no attribute 'display_name':

  { findNodes(...) { current { columns { displayName } cubeMetrics { name } } } }

This is because the name-only cube fast path replaces current.columns with lightweight _RawColumn stand-ins to skip ORM hydration, but the predicate that gated the optimization only looked at the cube subfields, so a query that also requested full columns data still took the fast path and overwrote the real columns with the bare stand-ins.

The predicate now also check for columns / primaryKey at the same selection level, so the fast path is skipped whenever the client needs the real column data.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit b68c858
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69e7e6322f332d0008756980

@shangyian shangyian changed the title Fix issue where requesting columns on cubes fails due to the fast-pat… Fix cube crash when requesting columns Apr 21, 2026
@shangyian shangyian added the bug Something isn't working label Apr 21, 2026
@shangyian shangyian marked this pull request as ready for review April 21, 2026 22:55
@shangyian shangyian merged commit 66d3994 into DataJunction:main Apr 21, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant