Skip to content

Commit

Permalink
Limit to 2 alter_data_batches concurrently (#5125)
Browse files Browse the repository at this point in the history
* Limit to 10 alter_data_batches concurrently

* Reduce to 2 concurrent batches
  • Loading branch information
stacimc authored Oct 31, 2024
1 parent ea7766d commit 071e422
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions catalog/dags/data_refresh/alter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_alter_batches(
return [(x, x + batch_size - 1) for x in range(start, stop, batch_size)]


@task
@task(max_active_tis_per_dagrun=2)
def alter_data_batch(
batch: tuple[int, int],
temp_table: str,
Expand Down Expand Up @@ -203,7 +203,8 @@ def alter_table_data(
)

alter_data = alter_data_batch.partial(
temp_table=temp_table, postgres_conn_id=postgres_conn_id
temp_table=temp_table,
postgres_conn_id=postgres_conn_id,
).expand(batch=batches)

report(alter_data)

0 comments on commit 071e422

Please sign in to comment.