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

✨ Add reset_metadata parameter to .load() #3728

Closed
wants to merge 3 commits into from

Conversation

Marigold
Copy link
Collaborator

@Marigold Marigold commented Dec 17, 2024

Fix for #3724 (comment)

ds.load(reset_metadata=True) lets you load a dataset and reset all its metadata (origins, titles, etc.). This is especially useful when working with population table. Division by population could propagate unwanted metadata such as presentation.title_public.

@Marigold Marigold changed the title ✨ Add reset_metadata paramter to .load ✨ Add reset_metadata parameter to .load Dec 17, 2024
@Marigold Marigold changed the title ✨ Add reset_metadata parameter to .load ✨ Add reset_metadata parameter to .load() Dec 17, 2024
@owidbot
Copy link
Contributor

owidbot commented Dec 17, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-add-reset-metadata

chart-diff: ✅ No charts for review.

Edited: 2024-12-17 08:50:11 UTC
Execution time: 6.97 seconds

@owidbot
Copy link
Contributor

owidbot commented Dec 17, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-add-reset-metadata

chart-diff: ✅ No charts for review.
data-diff: ✅ No differences found
= Dataset garden/artificial_intelligence/2023-06-14/ai_national_strategy
  = Table ai_national_strategy
= Dataset garden/artificial_intelligence/2023-06-26/ai_wrp_2021
  = Table ai_wrp_2021
= Dataset garden/artificial_intelligence/2023-06-26/ai_wrp_2021_grouped
  = Table ai_wrp_2021_grouped
= Dataset garden/who/2023-04-03/flu_vaccine_policy
  = Table flu_vaccine_policy


Legend: +New  ~Modified  -Removed  =Identical  Details
Hint: Run this locally with etl diff REMOTE data/ --include yourdataset --verbose --snippet

Automatically updated datasets matching weekly_wildfires|excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included

Edited: 2024-12-17 08:50:11 UTC
Execution time: 18.16 seconds

@spoonerf
Copy link
Contributor

spoonerf commented Dec 17, 2024

Nice!

Would it be possible to have the option to preserve the origins? I've had a go in this PR. I was thinking we probably still want to record in the origins when we've used population (etc) to create a new variable, but it's the other parts of the VariableMeta() that we would want to be rid of.

@Marigold
Copy link
Collaborator Author

Closing in favour of #3731 (review)

@Marigold Marigold closed this Dec 18, 2024
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.

3 participants