Interpolate sql in SQLDataset in catalog.yml

Question:

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

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

Thanks in advance!

Asked By: Nikola

||

Answers:

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.