Testare manualmente una data pipeline

ETL and ELT in Python

Jake Roach

Data Engineer

Testare le data pipeline

Le data pipeline vanno testate a fondo

  • Verifica che i dati siano estratti, trasformati e caricati come previsto

$$

Validare le pipeline riduce la manutenzione dopo il rilascio

  • Individua e risolve problemi di qualità dei dati
  • Migliora l'affidabilità dei dati

Strumenti e tecniche per testare le data pipeline

  • Test end-to-end
  • Validazione dei dati ai "checkpoint"
  • Unit test
ETL and ELT in Python

Ambienti di test e di produzione

Ambienti di test e produzione per creare ed eseguire data pipeline.

ETL and ELT in Python

Testare una pipeline end-to-end

Test end-to-end di una data pipeline.

Test end-to-end

  • Conferma che la pipeline giri in tentativi ripetuti
  • Valida i dati ai checkpoint della pipeline
  • Fai peer review e integra i feedback
  • Assicura accesso e soddisfazione degli utenti finali
ETL and ELT in Python

Validare i checkpoint della pipeline

# Extract, transform, and load data as part of a pipeline
...

# Take a look at the data made available in a Postgres database
loaded_data = pd.read_sql("SELECT * FROM clean_stock_data", con=db_engine)
print(loaded_data.shape)
(6438, 4)
print(loaded_data.head())
         timestamps      volume      open     close                            
1997-05-15 13:30:00  1443120000  0.121875  0.097917
1997-05-16 13:30:00   294000000  0.098438  0.086458
1997-05-19 13:30:00   122136000  0.088021  0.085417
ETL and ELT in Python

Validare i DataFrame

# Extract, transform, and load data, as part of a pipeline
...

# Take a look at the data made available in a Postgres database
loaded_data = pd.read_sql("SELECT * FROM clean_stock_data", con=db_engine)

# Compare the two DataFrames.
print(clean_stock_data.equals(loaded_data))
True
ETL and ELT in Python

Esercitiamoci!

ETL and ELT in Python

Preparing Video For Download...