-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: transforms aggregated completion "progress" events into a new fact #1
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, good find 👍
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
dbt_project.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.X
I'm not sure how to keep it in sync for every release of aspects-dbt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_completions
table to thereporting
schema.This new table is the same as
fact_completion
but also includes theresults.completion
field as acompleted
boolean.Part of: openedx/openedx-aspects#222