Skip to content

Commit

Permalink
Merge pull request #2161 from fedspendingtransparency/fix/missing-awa…
Browse files Browse the repository at this point in the history
…rds-for-update

[HOTFIX] Added check for earliest transaction FKs
  • Loading branch information
tony-sappe authored Dec 7, 2019
2 parents 6887dc7 + 744aec5 commit d9e8a58
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions usaspending_api/etl/transaction_loaders/fpds_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ def delete_stale_fpds(date):
# in the update awards stage later on
cursor.execute(
"update awards set latest_transaction_id = null, earliest_transaction_id = null "
"where latest_transaction_id in ({}) returning id".format(
",".join([str(row[0]) for row in transaction_normalized_ids])
)
"where latest_transaction_id in ({ids}) or earliest_transaction_id in ({ids}) "
"returning id".format(ids=",".join([str(row[0]) for row in transaction_normalized_ids]))
)
awards_touched = cursor.fetchall()

Expand Down

0 comments on commit d9e8a58

Please sign in to comment.