프로덕션에서 데이터 파이프라인 실행하기

Python으로 ETL과 ELT

Jake Roach

Data Engineer

데이터 파이프라인 아키텍처 패턴

# Define ETL function
...
def load(clean_data):
...

# Run the data pipeline
raw_stock_data = extract("raw_stock_data.csv")
clean_stock_data = transform(raw_stock_data)
load(clean_stock_data)

> ls
 etl_pipeline.py
# Import extract, transform, and load functions
from pipeline_utils import extract, transform, load

# Run the data pipeline
raw_stock_data = extract("raw_stock_data.csv")
clean_stock_data = transform(raw_stock_data)
load(clean_stock_data)

> ls
 etl_pipeline.py
 pipeline_utils.py
Python으로 ETL과 ELT

데이터 파이프라인 전체 실행하기

import logging
from pipeline_utils import extract, transform, load

logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
try:
    # Extract, transform, and load data
    raw_stock_data = extract("raw_stock_data.csv")
    clean_stock_data = transform(raw_stock_data)
    load(clean_stock_data)

    logging.info("Successfully extracted, transformed and loaded data.")  # Log success message

# Handle exceptions, log messages
except Exception as e:
    logging.error(f"Pipeline failed with error: {e}")
Python으로 ETL과 ELT

프로덕션에서 데이터 파이프라인 오케스트레이션

시장 점유율별 오케스트레이션 도구.

1 https://open.substack.com/pub/seattledataguy/p/the-state-of-data-engineering-part?r=1po78c&utm_campaign=post&utm_medium=web
Python으로 ETL과 ELT

연습해 봅시다!

Python으로 ETL과 ELT

Preparing Video For Download...