Refactor domain-neutral duplicate detection parameters - #123
Open
Oluwajuwon-O wants to merge 6 commits into
Open
Refactor domain-neutral duplicate detection parameters#123Oluwajuwon-O wants to merge 6 commits into
Oluwajuwon-O wants to merge 6 commits into
Conversation
20 tasks
Same CI pylint threshold issue as datakind#122; this stacked branch still carried the pre-fix test module and failed lint at 6.79 (< 7.0).
Integration CI failed because the expected UUID was computed from alphabetical JSON key order, while the insert trigger's jsonb cast produces a different deterministic test_id.
Postgres jsonb returns keys in a deterministic order that differs from the hand-edited fixture string; align the expected summary row.
Oluwajuwon-O
marked this pull request as ready for review
August 7, 2026 09:48
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.
Description
This PR addresses the domain-neutral duplicate detection issues described in the technical documentation:
Healthcare-Specific Duplicate Detection
Previously, the dbt macro used to flag duplicate records (
test_possible_duplicate_forms.sql) was heavily coupled to healthcare terminology. It expected parameters liketable_specific_reported_dateandtable_specific_patient_uuid. This hardcoded vocabulary limited the reusability of the test for other domains (e.g., education or finance), where terms like "patient" or "form" are contextually inaccurate.Resolution
test_possible_duplicate_forms.sqlto use generic parameter names:date_column,group_column,id_column, andperiod.2-upload_static_data.sql,4-upload_sample_dot_data.sql, andREADME.mdto reflect the new parameter interface.utils/configuration_utils.py(prepare_test_parameters). If DOT encounters legacy healthcare keys in a user's database, it automatically maps them to the new domain-neutral keys at runtime.test_entity_id_normalize.pyto guarantee that legacy parameter translation works flawlessly and prevents breaking changes for existing deployments.test_results.csvandtest_results_summary.csvto align with the new test parameter signatures.In the Technical Documentation, this is addressed in Section 7.
Asana Task
Deployment Readiness*
Testing
Describe or check:
Deployment Notes
Describe or check:
Rollback Plan
Describe or check:
git revert)Reviewer Guidance / Questions*
Screenshots / Testing Evidence*
SOC 2 Change Management Checklist
./vendor/bin/pest)Provide justification if you are submitting a PR with any boxes checked other than the first.
Reminder for Reviewers: By approving this PR you are confirming that you have reviewed the code for correctness, security, and compliance with our engineering and SOC 2 standards. Do not approve PRs where SOC 2 checklist items are checked without documented justification.
*Optional