Skip to content

Commit 7895e8d

Browse files
authored
Merge pull request #569 from DataIntegrationGroup/fix/backfill-orchestrator-logging
Backfill orchestrator should log outcomes and preserve tracebacks
2 parents 040e787 + c77f598 commit 7895e8d

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

transfers/backfill/backfill.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ def run(batch_size: int = 1000) -> None:
4949
logger.info(f"Skipping backfill: {name} ({flag}=false)")
5050
continue
5151
logger.info(f"Starting backfill: {name}")
52-
fn(batch_size)
53-
logger.info(f"Completed backfill: {name}")
52+
result = fn(batch_size)
53+
logger.info(
54+
f"Completed backfill: {name} — "
55+
f"inserted={result.inserted} updated={result.updated} "
56+
f"skipped_orphans={result.skipped_orphans} errors={len(result.errors)}"
57+
)
58+
if result.errors:
59+
for err in result.errors:
60+
logger.warning(f" {name}: {err}")
5461

5562

5663
def _parse_args() -> argparse.Namespace:
@@ -68,8 +75,8 @@ def _parse_args() -> argparse.Namespace:
6875
args = _parse_args()
6976
try:
7077
run(batch_size=args.batch_size)
71-
except Exception as exc:
72-
logger.critical(f"Backfill orchestration failed: {exc}")
78+
except Exception:
79+
logger.critical("Backfill orchestration failed", exc_info=True)
7380
sys.exit(1)
7481

7582
# ============= EOF =============================================

0 commit comments

Comments
 (0)