Skip to content

Conversation

paco-valdez
Copy link
Member

@paco-valdez paco-valdez commented Sep 10, 2025

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

This PR fixed the drill-down error with Views and drillMembers . Fixes #6778 .

The real issue wasn't in the client code, but in the schema compiler. Views weren't inheriting drillMembers and drillMembersGrouped properties from their source cubes.

Solution Implemented:

  File: /packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts:812-813
  ...(resolvedMember.drillMembers && { drillMembers: resolvedMember.drillMembers }),
  ...(resolvedMember.drillMembersGrouped && { drillMembersGrouped: resolvedMember.drillMembersGrouped }),

Added these lines to the generateIncludeMembers method to ensure Views properly inherit drill member properties from their source cubes.

Also edited packages/cubejs-schema-compiler/src/compiler/CubeToMetaTransformer.js to filter inherited drill members to only pass on available members.

Also added comprehensive test showing Views inherit drillMembers correctly

@paco-valdez paco-valdez requested a review from a team as a code owner September 10, 2025 17:42
Comment on lines +258 to +264

view(\`OrdersSimpleView\`, {
cubes: [{
join_path: Orders,
includes: ['createdAt', 'count']
}]
});
Copy link
Member Author

Choose a reason for hiding this comment

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

The important part is that id is a drill member for count, but it is not included.

Comment on lines +502 to +507
expect(countMeasure.drillMembers).toEqual(['OrdersSimpleView.createdAt']);
expect(countMeasure.drillMembersGrouped).toEqual({
measures: [],
dimensions: ['OrdersSimpleView.createdAt']
});
});
Copy link
Member Author

Choose a reason for hiding this comment

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

This is where we test that id is not in the drill members.

@paco-valdez
Copy link
Member Author

Ok I was able to do it in generateIncludeMembers , I just saw Mikhail PR after I finished, looks like now I'm in the correct path, our code looks very similar.

@paco-valdez
Copy link
Member Author

Superseded by #9966

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.

Measures in views don't inherit drill_members
2 participants