Skip to content

fix: review_data view remove duplicates - #1736

Open
zacharyjhankin wants to merge 4 commits into
developfrom
fix-view
Open

fix: review_data view remove duplicates#1736
zacharyjhankin wants to merge 4 commits into
developfrom
fix-view

Conversation

@zacharyjhankin

@zacharyjhankin zacharyjhankin commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

There was previously a bug in the view that shows review_data because there was a join that did not filter properly.

LEFT JOIN fap_meeting_decisions fmd ON fmd.proposal_pk = p.proposal_pk

became:

LEFT JOIN fap_meeting_decisions fmd ON fmd.proposal_pk = p.proposal_pk
AND fmd.instrument_id = i.instrument_id

As fap_meeting_decisions has an instrument_id column that was not being taken into account meaning multiple fap_meeting_decisions for different instruments would all be joined, effectively duplicating the rows we want for the entire view. As each row should represent one instrument.

You can test this by pressing the 'Export Fap Data' button in the calls screen. When you have proposals that have multiple fap reviews for different instruments on the same proposal. Then you get duplicates without my change. Or just execute the SQL to see what appears.

Motivation and Context

How Has This Been Tested

Fixes

Changes

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@zacharyjhankin
zacharyjhankin requested a review from a team as a code owner August 21, 2026 13:47
@zacharyjhankin
zacharyjhankin requested review from ellen-wright and removed request for a team August 21, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants