Interpolate sql in SQLDataset in catalog.yml


Is there a way to interpolate a SQLDataset query in catalog.yml passing some argumentparameter.

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

Thanks in advance!

Asked By: Nikola



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

Answered By: datajoely
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.