-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merge semantic model meta config #367
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
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.
@DevonFulcher I couldn't tell if the tests are verifying that meta
is "merging" rather than "clobbering".
Is there a way to add to the YAML contents and assertions of test case so that we know that it is merging rather than clobbering? I'm thinking a couple small additions could help differentiate.
assert semantic_model.dimensions[3].config.meta["dim_metadata"] == "gfds" | ||
assert semantic_model.dimensions[3].config.meta["sm_metadata"] == "asdf" |
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.
These lines cover the test cases I was thinking about here: #367 (review) ✅
Namely, it verifies that it merged the two dictionaries and has the sm_metadata
key/value inherited from the semantic model as well as the dim_metadata
key/value defined on the dimension.
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.
Per discussion with @DevonFulcher, we decided that enumerating similar test cases for entities and measures would be overkill because they are covered by the tests for dimensions.
The reason is that dimensions, entities, and measures are all treated the same here:
elements: Sequence[Union[PydanticDimension, PydanticEntity, PydanticMeasure]] = [
*sm.dimensions,
*sm.entities,
*sm.measures,
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.
🚀
Description
This PR implements the meta config merge behavior described here and referenced here.
I decided to stack this PR on top to keep it distinct from the other PRs, but I don't intend to merge this one into main directly. I will merge it into its parent branch first.
Checklist
I have runI'm not going to merge this directly into main, so we don't need a separate changelog entry.changie new
to create a changelog entry