Skip to content
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

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

DevonFulcher
Copy link
Contributor

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 read the contributing guide and understand what's expected of me
  • I have signed the CLA
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have run changie new to create a changelog entry I'm not going to merge this directly into main, so we don't need a separate changelog entry.

@cla-bot cla-bot bot added the cla:yes label Nov 11, 2024
@DevonFulcher DevonFulcher changed the title Merge meta config Merge semantic model meta config Nov 11, 2024
Copy link

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.

Copy link

@dbeatty10 dbeatty10 left a 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.

Comment on lines +615 to +616
assert semantic_model.dimensions[3].config.meta["dim_metadata"] == "gfds"
assert semantic_model.dimensions[3].config.meta["sm_metadata"] == "asdf"

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.

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,

Copy link

@dbeatty10 dbeatty10 left a comment

Choose a reason for hiding this comment

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

🚀

@DevonFulcher DevonFulcher merged commit e91a129 into consolidate_meta_config Nov 12, 2024
20 checks passed
@DevonFulcher DevonFulcher deleted the merge_meta_config branch November 12, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants