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

🔨 Allow passing parameters to YAML file #3231

Merged
merged 6 commits into from
Sep 3, 2024
Merged

Conversation

Marigold
Copy link
Collaborator

@Marigold Marigold commented Sep 2, 2024

Allow passing yaml_params dictionary to create_dataset function that makes them available in YAML template. This is especially useful as a replacement for {TODAY} "hack" that is causing spurious diffs.

Instead of

desc_update: The 2024 data is incomplete and was last updated {TODAY}.

we can now write

desc_update: The 2024 data is incomplete and was last updated {date_accessed}.

with

ds_garden = create_dataset(
        dest_dir, tables=[tb_agg], yaml_params={"date_accessed": tb_agg.yearly_count.m.origins[0].date_accessed}
    )

I'll start removing {TODAY} from recipes in a future PR.

@Marigold Marigold marked this pull request as ready for review September 2, 2024 11:01
@owidbot
Copy link
Contributor

owidbot commented Sep 2, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-yaml-parameters

chart-diff: ✅ No charts for review.
data-diff: ❌ Found differences
= Dataset garden/artificial_intelligence/2024-08-05/epoch_aggregates_affiliation
  = Table epoch_aggregates_affiliation
    ~ Column cumulative_count (changed metadata)
-       -   Describes the sector where the authors of a notable AI system have their primary affiliations. The 2024 data is incomplete and was last updated 16 August 2024.
        ?                                                                                                                                                   ^^
+       +   Describes the sector where the authors of a notable AI system have their primary affiliations. The 2024 data is incomplete and was last updated 05 August 2024.
        ?                                                                                                                                                   ^^
    ~ Column yearly_count (changed metadata)
-       -   Describes the sector where the authors of a notable AI system have their primary affiliations. The 2024 data is incomplete and was last updated 16 August 2024.
        ?                                                                                                                                                   ^^
+       +   Describes the sector where the authors of a notable AI system have their primary affiliations. The 2024 data is incomplete and was last updated 05 August 2024.
        ?                                                                                                                                                   ^^


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-09-02 13:26:19 UTC
Execution time: 13.70 seconds

@Marigold Marigold merged commit c1050f9 into master Sep 3, 2024
8 checks passed
@Marigold Marigold deleted the yaml-parameters branch September 3, 2024 06:22
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.

2 participants