Skip to main content

Resilient Record Importer

Challenge on lesson: Checkpoint: A Resilient Importer

Implement import_records(sources) where sources is a list of callables, each returning a list of dicts or raising. For each source: retry up to 2 times on failure; on final failure, log it (logger 'pi.importer', any level >= WARNING) and continue. Return the concatenated list of successfully fetched dicts. Preserve order. If EVERY source fails, raise ImportError-like error: raise RuntimeError('all sources failed').

Difficulty: intermediate

Back to lesson: Checkpoint: A Resilient Importer