duckdb / dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Apache License 2.0
816 stars 69 forks source link

Support alternate string formatting strategies for external sources #188

Closed jwills closed 1 year ago

jwills commented 1 year ago

Fixes this issue that CL Kao came across in the dbt Slack:

sources:
  - name: flights_source
    tables:
      - name: flights
        meta:
          external_location: "read_csv('flights.csv', types={'FlightDate': 'DATE'}, names=['FlightDate', 'UniqueCarrier'])"
causing
    ext_location = source_config.meta["external_location"].format(
KeyError: "'FlightDate'"
clkao commented 1 year ago

Thanks, @jwills! will test this.