Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed Jul 12, 2024
1 parent bba5c46 commit 2d03851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 1 addition & 13 deletions catalog/dags/database/catalog_cleaner/catalog_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

logger = logging.getLogger(__name__)

DAG_ID = "catalog_cleaner"


@task
def count_dirty_rows(temp_table_name: str, task: AbstractOperator = None):
Expand All @@ -45,16 +43,6 @@ def count_dirty_rows(temp_table_name: str, task: AbstractOperator = None):

@task
def get_batches(total_row_count: int, batch_size: int) -> list[tuple[int, int]]:
# batch_list = []
# batch_start = 0
# while batch_start <= total_row_count:
# batch_end = min(batch_start + batch_size, total_row_count)
# batch_list.append({
# "batch_start": batch_start,
# "batch_end": batch_end
# })
# batch_start += batch_size
# return batch_list
return [(i, i + batch_size) for i in range(0, total_row_count, batch_size)]


Expand Down Expand Up @@ -85,7 +73,7 @@ def update_batch(


@dag(
dag_id=DAG_ID,
dag_id=constants.DAG_ID,
default_args={
**DAG_DEFAULT_ARGS,
"retries": 0,
Expand Down
2 changes: 2 additions & 0 deletions catalog/dags/database/catalog_cleaner/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DAG_ID = "catalog_cleaner"

CREATE_SQL = """
DROP TABLE IF EXISTS {temp_table_name};
CREATE UNLOGGED TABLE {temp_table_name} (
Expand Down

0 comments on commit 2d03851

Please sign in to comment.