Skip to content

Commit

Permalink
hotfix: fix partitions, replace pm round
Browse files Browse the repository at this point in the history
  • Loading branch information
cbini committed Sep 22, 2023
1 parent abac229 commit cc48dca
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ lint:
- git-diff-check
- [email protected]
- [email protected]
- markdownlint@0.36.0
- markdownlint@0.37.0
- [email protected]
- [email protected]
- [email protected]
Expand Down
127 changes: 63 additions & 64 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"pyodbc>=4.0.35",
"python-snappy>=0.6.1",
"beautifulsoup4>=4.12.2",
"dbt-bigquery>=1.5.3",
"dbt-bigquery!=1.6.5",
"ldap3>=2.9.1",
"pycryptodome>=3.18.0",
"pandas>=2.0.3",
Expand Down
34 changes: 25 additions & 9 deletions src/dbt/kippmiami/models/fldoe/staging/stg_fldoe__fast.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,31 @@ with
`3_geometric_reasoning_measurement_and_data_analysis_and_probability_performance`,
`4_geometric_reasoning_measurement_and_data_analysis_and_probability_performance`
) as geometric_reasoning_measurement_and_data_analysis_and_probability,
from {{ source('fldoe', 'src_fldoe__fast') }}
from {{ source("fldoe", "src_fldoe__fast") }}
),

with_calcs as (
select
* except (percentile_rank),
safe_cast(
regexp_extract(percentile_rank, r'\d+') as numeric
) as percentile_rank,
safe_cast(
regexp_extract(achievement_level, r'\d+') as int
) as achievement_level_int,
lag(scale_score, 1) over (
partition by student_id, academic_year, assessment_subject
order by administration_window asc
) as scale_score_prev,
from fast_data
)

select
* except (percentile_rank),
safe_cast(regexp_extract(percentile_rank, r'\d+') as numeric) as percentile_rank,
safe_cast(regexp_extract(achievement_level, r'\d+') as int) as achievement_level_int,
lag(scale_score, 1) over (
partition by student_id, academic_year, assessment_subject
order by administration_window asc
) as scale_score_prev,
from fast_data
*,
case
when achievement_level_int >= 3
then true
when achievement_level_int < 3
then false
end as is_proficient,
from with_calcs
Loading

0 comments on commit cc48dca

Please sign in to comment.