A Python automation performs multi-step operations across GCS and BigQuery. If the BigQuery load fails after the CSV is moved to a “processed” folder, what recovery strategy best preserves correctness?

Answer

Move the file only after the BigQuery load succeeds, or use a two-phase naming/marker approach (staging then commit)

Explanation

Correctness requires the state transition to “processed” be coupled to successful ingestion. A staging/commit pattern prevents lost or prematurely finalized data.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list