Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Make `additional_where` optional for batched update (#4872)
Madison Swain-Bowdencea805019e25
diff --git a/catalog/dags/database/batched_update/batched_update.py b/catalog/dags/database/batched_update/batched_update.pyindex 55173f37a..b0f185021 100644--- a/catalog/dags/database/batched_update/batched_update.py+++ b/catalog/dags/database/batched_update/batched_update.py@@ -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,)diff --git a/catalog/dags/database/batched_update/batched_update_dag.py b/catalog/dags/database/batched_update/batched_update_dag.pyindex 8295e6442..9c9009199 100644--- a/catalog/dags/database/batched_update/batched_update_dag.py+++ b/catalog/dags/database/batched_update/batched_update_dag.py@@ -139,8 +139,8 @@ DAG_CONFIG = dict(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 "diff --git a/catalog/tests/dags/database/test_batched_update.py b/catalog/tests/dags/database/test_batched_update.pyindex c875ad512..bef49aa55 100644--- a/catalog/tests/dags/database/test_batched_update.py+++ b/catalog/tests/dags/database/test_batched_update.py@@ -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,@@ -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,@@ -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,