Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pomegranited committed Jun 21, 2024
1 parent 560a395 commit fa0f1b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions models/completion_aggregator/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ models:
- name: scaled_progress
description: "A ratio between 0 and 1, inclusive, of the learner's progress"
data_type: Float32
data_tests:
- is_completed
- name: completion_bucket
description: "A displayable value of progress sorted into 10% buckets. Useful for grouping progress together to show high-level learner performance"
data_type: String
- name: completed
description: "Flag indicating whether the object has been fully completed"
data_type: Bool
data_tests:
- is_completed:
progress_field: "scaled_progress"
- name: username
data_type: String
description: "The username of the learner"
Expand Down Expand Up @@ -83,3 +84,6 @@ models:
- name: completed
description: "Flag indicating whether the object has been fully completed"
data_type: Bool
data_tests:
- is_completed:
progress_field: "progress_percent"
8 changes: 4 additions & 4 deletions tests/generic/test_is_completed.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% test is_completed(model) %}
{% test is_completed(model, progress_field) %}

with validation as (

select
completion,
scaled_progress
{{ progress_field }} as progress,

from {{ model }}

Expand All @@ -16,8 +16,8 @@ validation_errors as (
completion, scaled_progress

from validation
-- if this is true, then scaled_progress isn't being captured correctly
where completion == true and scaled_progress < 100
-- if this is true, then progress isn't being captured correctly
where completion == true and progress < 100

)

Expand Down

0 comments on commit fa0f1b1

Please sign in to comment.