Skip to content

Bugfix member months grain#918

Closed
davidshimamoto wants to merge 3 commits into
mainfrom
bugfix-member-months-grain
Closed

Bugfix member months grain#918
davidshimamoto wants to merge 3 commits into
mainfrom
bugfix-member-months-grain

Conversation

@davidshimamoto

Copy link
Copy Markdown
Contributor

Describe your changes

member_months breaks when a person with multiple plan memberships is fed into the input layer eligibility file. Because member_id is part of the model, this results in multiple rows per person_id. To fix this, I nulled out member_id, and applied an aggregate to the eligibility data as it's staged for member months to get it to the correct grain.

How has this been tested?

Ran the model with synthetic data that simulates the problem.

Reviewer focus

Note that tuva_last_run has been omitted, but this field is not used anywhere, so it was not needed.

Checklist before requesting a review

  • I have added at least one Github label to this PR (bug, enhancement, breaking change,...)
  • My code follows style guidelines
  • (New models) YAML files are categorized by sub folder and models listed in alphabetical order
  • (New models) I have added a config to each new model to enable it for claims and/or clinical data
  • (New models) I have added the variable tuva_last_run to the final output
  • (Optional) I have recorded a Loom to explain this PR

Package release checklist

  • I have updated dbt docs
  • I have updated the version number in the dbt_project.yml

(Optional) Gif of how this PR makes you feel

Loom link

@davidshimamoto davidshimamoto added bug Something isn't working community Issues created by community members labels Jun 13, 2025
@github-project-automation github-project-automation Bot moved this to 👀 Ready for Review in The Tuva Project Jun 13, 2025
@github-actions

Copy link
Copy Markdown

SQLFluff Linting Failed

Issues were found that require manual correction or are unfixable by sqlfluff fix.
Please review the output below (or the full logs), fix the issues locally, and commit the changes.

SQLFluff Run Log - Mode: ci, Fix: false, Time: Fri Jun 13 16:31:16 UTC 2025

===== SQLFLUFF LINT (Initial Check) OUTPUT (2025-06-13_16:36:12) (Filtered) =====

=== [dbt templater] Sorting Nodes...
=== [dbt templater] Compiling dbt project...
=== [dbt templater] Project Compiled.
== [models/claims_preprocessing/claims_enrollment/claims_enrollment__member_months.sql] FAIL
L:  17 | P:  11 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  33 | P:   7 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  46 | P:  55 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  54 | P:  54 | LT12 | Files must end with a single trailing newline.
                       | [layout.end_of_file]
All Finished!

=========================================================================


===== SQLFLUFF FIX (Check, Informational) OUTPUT (2025-06-13_16:41:08) (Filtered) =====

==== finding fixable violations ====
=== [dbt templater] Sorting Nodes...
=== [dbt templater] Compiling dbt project...
=== [dbt templater] Project Compiled.
== [models/claims_preprocessing/claims_enrollment/claims_enrollment__member_months.sql] FAIL
L:  17 | P:  11 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  33 | P:   7 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  46 | P:  55 | LT01 | Unnecessary trailing whitespace. [layout.spacing]
L:  54 | P:  54 | LT12 | Files must end with a single trailing newline.
                       | [layout.end_of_file]
== [models/claims_preprocessing/claims_enrollment/claims_enrollment__member_months.sql] FIXED
4 fixable linting violations found

=========================================================================

@sarahmcmorgan sarahmcmorgan added the stale No recent updates or commits label Aug 25, 2025
@github-project-automation github-project-automation Bot moved this from 👀 Ready for Review to ✅ Done in The Tuva Project Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working community Issues created by community members stale No recent updates or commits

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants