Skip to content

Commit

Permalink
Make additional_where optional for batched update (#4872)
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound authored Sep 5, 2024
1 parent 668b43a commit cea8050
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion catalog/dags/database/batched_update/batched_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def update_batches(
timeout=update_timeout,
table_name=table_name,
update_query=update_query,
additional_where=additional_where,
additional_where=additional_where or "",
batch_start=batch_start,
batch_end=batch_end,
)
Expand Down
4 changes: 2 additions & 2 deletions catalog/dags/database/batched_update/batched_update_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
pattern="^SET updated_on = NOW()",
),
"additional_where": Param(
default="",
type="string",
default=None,
type=["null", "string"],
description=(
"Additional `WHERE` clause to be appended to the `UPDATE` query. "
"Can be used when setting values based on an existing row in "
Expand Down
6 changes: 3 additions & 3 deletions catalog/tests/dags/database/test_batched_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_update_batches(
total_row_count=2,
batch_size=1,
update_query=update_query,
additional_where="",
additional_where=None,
update_timeout=3600,
batch_start_var=batch_start_var,
postgres_conn_id=sql.POSTGRES_CONN_ID,
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_update_batches_dry_run(
total_row_count=2,
batch_size=1,
update_query=update_query,
additional_where="",
additional_where=None,
update_timeout=3600,
batch_start_var=batch_start_var,
postgres_conn_id=sql.POSTGRES_CONN_ID,
Expand Down Expand Up @@ -281,7 +281,7 @@ def test_update_batches_resuming_from_batch_start(
total_row_count=3,
batch_size=1,
update_query=update_query,
additional_where="",
additional_where=None,
update_timeout=3600,
batch_start_var=batch_start_var,
postgres_conn_id=sql.POSTGRES_CONN_ID,
Expand Down

0 comments on commit cea8050

Please sign in to comment.