fix(enrollment_detail_report): fix two join fan-out bugs #2468
Merged
rachellougee merged 1 commit intoJul 22, 2026
Conversation
…update SQL logic for current courses
🔎 ol-dbt impact — column-level blast radius0 breaking, 0 warning, 1 info across 1 changed model(s). Details
Posted by |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the enrollment_detail_report dbt model to eliminate two confirmed join fan-out sources that could produce duplicate rows and inconsistent attribute values after the shift to dimensional models. It also adds a stable surrogate identifier (enrollment_key) to make row-level uniqueness easier to audit downstream.
Changes:
- Filter
dim_coursetois_current = trueto prevent SCD2 multi-version joins from producing duplicate enrollments / outdated course titles. - Deduplicate and join coupon/discount names by both
discount_codeandplatformto prevent cross-platform coupon name mismatches. - Expose
enrollment_keyin the report output and addnot_null+unique(warn-severity) tests in the reporting schema YAML.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ol_dbt/models/reporting/enrollment_detail_report.sql | Prevents course-title and coupon-name fan-out by constraining joins to current course rows and platform-scoped discount names; adds enrollment_key to output. |
| src/ol_dbt/models/reporting/_reporting__models.yml | Documents the new enrollment_key column and adds not_null + warn-severity unique tests for tracking/reporting duplicate-row issues. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
rachellougee
deleted the
fix/enrollment-detail-report-course-and-discount-scd2
branch
July 22, 2026 18:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
NA
Discovered by #2469
Description (What does it do?)
Fixes bugs in
enrollment_detail_reportthat caused duplicate rows (fan-out) for some enrollments, leading to inconsistent values after the switch to use dimensional modelsAlso exposes
enrollment_keyas a new output column — a reliable unique identifier for each row, to help catch and track down any remaining duplicate-row issuesTest plan
How can this be tested?
dbt build --select enrollment_detail_report- a warning due to tfact_certificate's user_fk issues that will be addressed separatelyConfirmed that coupon fields produce consistent values per platform
confirmed that course title shows the correct name for some courses
Additional Context