Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fix the contributors with active facilities report #991

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Mar 13, 2020

Overview

The first draft of the report had two issues that we only realized after running
the report with production data:

  • Lines were duplicated for contributor with multiple lists.
  • If any of the items on a contributor's list were in an error state, the
    contributor did not appear.

This commit attempts to address those issues by:

  • Using an IN clause with a subquery rather than joining the contributor table
    to the source table.
  • Inverting the error status filter condition to allow a contributor if any
    sources are in a non-error status.

Connects #988

Testing Instructions

NOTE I was was unable to reproduce the problem with contributors not appearing using development data at the time of opening this PR but, in the interest of getting a report out ASAP I have not waited until I could come up with a test situation.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

The first draft of the report had two issues that we only realized after running
the report with production data:

- Lines were duplicated for contributor with multiple lists.
- If any of the items on a contributor's list were in an error state, the
  contributor did not appear.

This commit attempts to address those issues by:

- Using an `IN` clause with a subquery rather than joining the contributor table
  to the source table.
- Inverting the error status filter condition to allow a contributor if any
  sources are in a non-error status.
@jwalgran jwalgran force-pushed the bugfix/jcw/update-contrib-with-active-report branch from 96ebd4b to 9490b9c Compare March 13, 2020 19:31
@jwalgran jwalgran marked this pull request as ready for review March 13, 2020 20:02
@jwalgran jwalgran requested a review from TaiWilkin March 13, 2020 20:02
@TaiWilkin
Copy link
Contributor

Looking at this now

@jwalgran
Copy link
Contributor Author

I ran the query for this on the production data and manually compared it to the response from /api/contributors/. Looks good.

@TaiWilkin
Copy link
Contributor

This looks great. Thanks for catching this!

@jwalgran
Copy link
Contributor Author

Thanks for the review.

@jwalgran jwalgran merged commit 52bc916 into develop Mar 13, 2020
@jwalgran jwalgran deleted the bugfix/jcw/update-contrib-with-active-report branch March 13, 2020 20:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants