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

Grab school year from the competition instead of date #130

Open
shippy opened this issue May 27, 2024 · 0 comments
Open

Grab school year from the competition instead of date #130

shippy opened this issue May 27, 2024 · 0 comments

Comments

@shippy
Copy link
Collaborator

shippy commented May 27, 2024

Each school year in question should include both the previous grand finals debate and the final tournament. Currently, however, the school_year is determined by

debates_in_years as (
    select
        *,
        date_sub('year', DATE '{{ var("first_school_year") }}', datum) as school_year
    from debates
),

in base__debata.sql. Instead, we should look at via source("raw", "debata").soutez_id into source("raw", "soutez").rocnik and use that. (It should be a match for the school_year stat, but we should double-check that.)

Therefore, to implement, we must:

  1. Add a CTE that extracts soutez_id, rocnik from source("raw", "soutez"), which should also be added to base/sources.yml`.
  2. Move current school_year column to school_year_calc and keep it in the debates_in_years CTE
  3. Rename the rocnik column from the first added CTE to school_year in debates_in_years CTE
  4. Double-check that max(school_year) == var("current_school_year")
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

No branches or pull requests

1 participant