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

metadata: Jinja templates are being inherited when a variable is used in calculation #3724

Closed
spoonerf opened this issue Dec 16, 2024 · 4 comments
Assignees

Comments

@spoonerf
Copy link
Contributor

I think this is a new occurrence: When you use an indicator that has Jinja metadata in a calculation (e.g., UN WPP population). The calculated variable inherits this template, and it can cause the step to fail if you don't overwrite the metadata values that are given in the template.

e.g. here in Buildkite. Buildkite is applying a template that doesn't exist in the metadata of the step, but it is the metadata for the variable used in a calculation in this step (etl/steps/data/garden/malnutrition/2024-12-16/malnutrition.py).

@spoonerf
Copy link
Contributor Author

(Maybe it's intentional, but in that case I guess it might be good to have a function to strip variable metadata for these kind of variables)

@Marigold Marigold self-assigned this Dec 16, 2024
@Marigold
Copy link
Collaborator

Thanks for reporting this. I've improved the error message to make it clear which variable and metadata are causing the problem.

In this specific case, the issue is that presentation.title_public is inherited from the population indicator, but it's missing the dimensions required to render the metadata. I'm not sure what the best approach is—should we stop inheriting the presentation.title_public field, or would that cause other problems?

@spoonerf
Copy link
Contributor Author

Would a function that strips Variable metadata be a possible way to go (or maybe an option in load_dataset())?

I figure it's presentation.title_public this time, but it could be a different one with another variable (although population will be by far the most frequent one!).

@Marigold
Copy link
Collaborator

That's a great idea, created a PR #3728.

@Marigold Marigold closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants