Skip to content

Commit

Permalink
Fix delete query
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 6, 2024
1 parent 928874f commit c4d2685
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions oonipipeline/src/oonipipeline/temporal/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def maybe_delete_prev_range(db: ClickhouseConnection, prev_range: PrevRange) ->
where = f"{where} AND created_at <= %(max_created_at)s AND created_at >= %(min_created_at)s"
log.debug(f"runing {where} with {q_args}")

q = f"DELETE FROM {prev_range.table_name}"
final_query = q + where
final_query = f"DELETE FROM {prev_range.table_name} {where}"
db.execute(final_query, q_args)
return final_query

Expand Down

0 comments on commit c4d2685

Please sign in to comment.