Hi, How can I parameterised a SQL data query base...
# questions
a
Hi, How can I parameterised a SQL data query based on the parameters.yml file? for example in catalog.yml I have
Copy code
my_sql:
 type: pandas.SQLQueryDataset
 sql: "SELECT * FROM [ABC].[date_20180401]"
 credentials: mycred
I want to use the following parameter from parameters.yml
Copy code
ABC:
 latest_date: "20180401"
So the expectation in catalog.yml would be something like
Copy code
my_sql:
 type: pandas.SQLQueryDataset
 sql: "SELECT * FROM [ABC].[date_{params[ABC.latest_date]}]"
 credentials: mycred
K 1
a
I think using globals might be more suited to this particular case instead of parameters
a
@Ahdra Merali thanks for the tips! I read about global.yml and I thought that it's also possible to reference the parameters from the parameters.yml file. I'll explore using global.yml
👍 1