https://kedro.org/ logo
#questions
Title
# questions
n

Nikola Shahpazov

03/15/2023, 1:17 PM
Hi guys, Quick question Is there a way to interpolate a SQLDataset query in
catalog.yml
passing some argument\parameter. Example:
Copy code
yaml
person:
  type: pandas.SQLQueryDataSet
  sql: "SELECT * FROM public.people WHERE id = ${id};"
  credentials: db_credentials
Thanks in advance!
d

datajoely

03/15/2023, 1:17 PM
you can use TemplatedConfigLoader to do this
but beware of SQL injection risks
d

Deepyaman Datta

03/15/2023, 1:24 PM
@Juan Luis do you have the example snippet you used recently (on the Kedro-Polars demo) handy?
n

Nikola Shahpazov

03/15/2023, 1:24 PM
@datajoely Thanks, it seemed to work.
kedroid 2
👍 2
d

datajoely

03/15/2023, 1:27 PM
would you mark as answered on StackOverflow? 🙂
n

Nikola Shahpazov

03/15/2023, 1:28 PM
Sure, just to 2 minutes to allow me to do that. Should have asked here directly.
d

datajoely

03/15/2023, 1:28 PM
No worries!
n

Nikola Shahpazov

03/15/2023, 1:34 PM
@datajoely Is there a way to pass the parameter from inside kedro node instead of using globals?
d

datajoely

03/15/2023, 1:49 PM
@Nikola Shahpazov sort of - if you override a specific
parameters
those can passed to nodes
3 Views