CSV

This connector is used to read local CSV files.

Connection configuration

No connection is required by this connector.

Test case configuration

NameMandatoryDefaultDescription
pathyesPath to the CSV file
delimiterno,Delimiter used in the CSV file
infernotrueInfer column names from the first row
namesnoList of column labels to apply
schemanoDictionary of column names and types (int, float, string, bool, datetime)
usecolsnoList of columns to select
skiprowsnoNumber of rows to skip at the start, or list of row indices to skip (0-indexed)
skipfooterno0Number of rows to skip at the end of the file
nrowsnoNumber of rows to read
lineterminatornoCharacter used to denote a line break
quotecharno"Character used to denote the start and end of a quoted item
encodingnoutf-8Encoding to use when reading the file
enginenoParser engine to use (c or python)

Example

Example CSV:
  source:
    type: csv
    path: ./data/employees.csv
    delimiter: ";"
    encoding: utf-8
  expected:
    type: csv
    path: ./data/expected_employees.csv

Example with schema

Example CSV with schema:
  source:
    type: csv
    path: ./data/employees.csv
    schema:
      id: int
      name: string
      salary: float
      hire_date: datetime
  expected:
    type: empty

Example without header

Example CSV without header:
  source:
    type: csv
    path: ./data/no_header.csv
    infer: false
    names:
      - id
      - name
      - department
  expected:
    type: empty