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!
Answers:
As answered on slack you can use TemplatedConfigLoader, but beware of SQL injection risks!
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!
As answered on slack you can use TemplatedConfigLoader, but beware of SQL injection risks!