-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(schema-compiler): Add drillMembers to inherited properties by views #9959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(schema-compiler): Add drillMembers to inherited properties by views #9959
Conversation
|
||
view(\`OrdersSimpleView\`, { | ||
cubes: [{ | ||
join_path: Orders, | ||
includes: ['createdAt', 'count'] | ||
}] | ||
}); |
There was a problem hiding this comment.
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.
expect(countMeasure.drillMembers).toEqual(['OrdersSimpleView.createdAt']); | ||
expect(countMeasure.drillMembersGrouped).toEqual({ | ||
measures: [], | ||
dimensions: ['OrdersSimpleView.createdAt'] | ||
}); | ||
}); |
There was a problem hiding this comment.
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.
packages/cubejs-schema-compiler/src/compiler/CubeToMetaTransformer.js
Outdated
Show resolved
Hide resolved
packages/cubejs-schema-compiler/src/compiler/CubeToMetaTransformer.js
Outdated
Show resolved
Hide resolved
packages/cubejs-schema-compiler/src/compiler/CubeToMetaTransformer.js
Outdated
Show resolved
Hide resolved
Ok I was able to do it in |
Superseded by #9966 |
Check List
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:
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