pythonkedro

Interpolate sql in SQLDataset in catalog.yml


Is there a way to interpolate a SQLDataset query in catalog.yml passing some argument\parameter. Example:

person:
  type: pandas.SQLQueryDataSet
  sql: "SELECT * FROM public.people WHERE id = ${id};"
  credentials: db_credentials

Thanks in advance!


Solution

  • As answered on slack you can use TemplatedConfigLoader, but beware of SQL injection risks!