feat: transforms aggregated completion "progress" events into a new fact#1
feat: transforms aggregated completion "progress" events into a new fact#1pomegranited merged 6 commits intomainfrom
Conversation
fa0f1b1 to
1e64447
Compare
|
Hi @bmtcril @Ian2012 I wrote this dbt package to go along with the completion aggregator xAPI events added by open-craft/openedx-completion-aggregator#205, but I'm having trouble with the target schema: it's using I also tried:
Can you see where I've gone wrong? |
|
|
||
| models: | ||
| - name: fact_aggregated_completions | ||
| database: "{{ env_var('DBT_PROFILE_TARGET_DATABASE', 'reporting') }}" |
There was a problem hiding this comment.
I'm seeing the same issue you are and I think this is your problem. Since Clickhouse doesn't have a concept of database, only schema when database and schema are both defined dbt_clickhouse seems to treat database as a prefix. I think if you delete this line it should work as expected.
FWIW I do also see this successfully being created in a new reporting_xapi schema and otherwise it seems to work!
There was a problem hiding this comment.
Aspects v1.0.2 solved an issue in which the environment variable for the reporting schema was not correctly set.
There was a problem hiding this comment.
Since Clickhouse doesn't have a concept of database, only schema when database and schema are both defined dbt_clickhouse seems to treat database as a prefix.
That's exactly what happened! I ended up deleting the schema="xapi" instead of removing database="reporting" here, because the rest of the fact_* tables are all under the reporting database, cf 8859f6a.
| config( | ||
| materialized="materialized_view", | ||
| schema=env_var("ASPECTS_XAPI_DATABASE", "xapi"), | ||
| engine=aspects.get_engine("ReplacingMergeTree()"), |
There was a problem hiding this comment.
@bmtcril FYI I also had to qualify this Aspects get_engine macro with the aspects. prefix.
Will note this in a "troubleshooting" docs PR, because this was difficult to debug :)
b1e28c7 to
79dba6c
Compare
79dba6c to
0aa1cbc
Compare
Files generated by `dbt init`
and use the aspects profile and target path.
We only need the database name.
… + user and adds a test
0aa1cbc to
66e4d0f
Compare
to use as label for subsection chart
There was a problem hiding this comment.
For this to "extend" Aspects, you need to add a packages.yml file with:
packages:
- git: "https://github.com/openedx/aspects-dbt.git"
revision: vX.X.XI'm not sure how to keep it in sync for every release of aspects-dbt.
There was a problem hiding this comment.
You can use semantic versioning, fwiw:
packages:
- git: "https://github.com/openedx/aspects-dbt.git"
version: [">=0.7.0", "<0.8.0"]
It's difficult to know what's a "breaking change" in dbt land, we should probably write up criteria.
There was a problem hiding this comment.
You can use semantic versioning, fwiw:
Nope, dbt doesn't like that, raises a Validator error (docs)
I'm not sure how to keep it in sync for every release of aspects-dbt.
Maybe there's a tutor templated way? But I think it can be manual for now.
There was a problem hiding this comment.
We could inject it, but @bmtcril wanted to avoid introducing breaking changes
c638929 to
9e223e5
Compare
Extends https://github.com/openedx/aspects-dbt/ to add a new
fact_aggregated_completionstable to thereportingschema.This new table is the same as
fact_completionbut also includes theresults.completionfield as acompletedboolean.Part of: openedx/openedx-aspects#222