Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jinja template examples in README are wrong #33

Open
wmartin-gss opened this issue Sep 13, 2022 · 0 comments
Open

Jinja template examples in README are wrong #33

wmartin-gss opened this issue Sep 13, 2022 · 0 comments

Comments

@wmartin-gss
Copy link

I think the Jinja template examples in the README are incorrect, putting the Jinja arguments in a python dictionary-like format instead of an R format and leading to errors as a result. The example in the vignettes worked correctly for me.

Error message

> sql_template <- "SELECT * FROM {{ db_name }}.{{ table }}"
> sql <- dbtools::render_sql_template(sql_template, {"db_name": "name", "table": "department"})
Error: unexpected ',' in "sql <- dbtools::render_sql_template(sql_template, {"db_name": "name","

Fix

> sql_template <- "SELECT * FROM {{ db_name }}.{{ table }}"
> sql <- dbtools::render_sql_template(sql_template, list(db_name = "name", table = "department"))
> sql
[1] "SELECT * FROM name.department"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant