Skip to content

Commit

Permalink
pg get_updated_rows pulls all rows if cutoff_value is None
Browse files Browse the repository at this point in the history
This is needed for db_sync upsert to work if the destination table
exists but is empty
  • Loading branch information
austinweisgrau committed Oct 10, 2024
1 parent d9f5c43 commit 2005894
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions parsons/databases/postgres/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def get_updated_rows(
sql = f"""
SELECT *
FROM {self.table}
WHERE "{updated_at_column}" > %s
"""
parameters = []

Expand All @@ -138,6 +137,6 @@ def get_updated_rows(

sql += f" OFFSET {offset}"

result = self.db.query(sql, parameters=[cutoff_value])
result = self.db.query(sql, parameters=parameters)

return result

0 comments on commit 2005894

Please sign in to comment.