# Single-file pipeline: CSV → transform → CSV
# Use with Pipeline.from_config_file("data/etl_examples/pipeline.yaml")
# or paste extract/transform/load sections into the ETL UI panels.

name: csv_to_csv_example
version: "1.0.0"
description: Extract from CSV, transform, load to CSV

extract:
  type: file
  path: ${INPUT_PATH:-data/etl_examples/input.csv}
  format: csv
  batch_size: 1000
  csv_options:
    delimiter: ","
    quote_char: '"'
    has_header: true

transform:
  - rename:
      product_id: id
      product_name: name
      updated_at: source_updated_at
  - convert:
      price: float
      quantity: int
      source_updated_at: datetime
  - defaults:
      category: "uncategorized"
  - add:
      processed_at: "now()"
      source: "etl_example"
  - select:
      - id
      - name
      - category
      - price
      - quantity
      - source_updated_at
      - processed_at
      - source

load:
  type: file
  path: ${OUTPUT_PATH:-data/etl_examples/output.csv}
  format: csv
  write_mode: overwrite
  csv_options:
    delimiter: ","
    quote_char: '"'
    include_header: true
