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

Fix MetricSchema loading #159

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Fix MetricSchema loading #159

merged 2 commits into from
Dec 5, 2022

Conversation

betodealmeida
Copy link
Member

Fixes #157

We were dropping the new metric fields when loading the metrics. I added them to MetricSchema, and also changed the loading so that we don't drop new fields in the future.

@betodealmeida betodealmeida changed the title Fix MetricSchema loading Fix MetricSchema loading Dec 5, 2022
@@ -110,7 +110,7 @@ def get_metrics_for_model(
)
break

if model["unique_id"] == parents.pop():
if parents == {model["unique_id"]}:
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you want to use the .pop ?

Copy link
Member Author

Choose a reason for hiding this comment

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

pop modified the object inplace, and even though we don't need it later I thought the new approach represents better what I want to test (I want to make sure that parents is a set with a single element and that element is equal to model['unique_id']).

Copy link
Contributor

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

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

LGTM

@betodealmeida betodealmeida merged commit a9bb9a2 into main Dec 5, 2022
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.

Support for dbt-core 1.3: Missing fields in MetricSchema Class
2 participants