Skip to content

Commit 8fc842d

Browse files
authored
Write backfills json even if no backfills to process (#5209)
1 parent adf2d6b commit 8fc842d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bigquery_etl/cli/backfill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def scheduled(ctx, qualified_table_name, sql_dir, project_id, status, json_path=
310310

311311
click.echo(f"{len(backfills)} backfill(s) require processing.")
312312

313-
if backfills and json_path is not None:
313+
if json_path is not None:
314314
formatted_backfills = [
315315
{
316316
"qualified_table_name": qualified_table_name,

tests/cli/test_cli_backfill.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import os
23
from datetime import date, timedelta
34
from pathlib import Path
@@ -1830,6 +1831,7 @@ def test_backfill_scheduled(self, get_table, runner):
18301831
assert result.exit_code == 0
18311832
assert "1 backfill(s) require processing." in result.output
18321833
assert Path("tmp.json").exists()
1834+
assert len(json.loads(Path("tmp.json").read_text())) == 1
18331835

18341836
result = runner.invoke(
18351837
scheduled,

0 commit comments

Comments
 (0)