toucan-connectors icon indicating copy to clipboard operation
toucan-connectors copied to clipboard

Deprecate %s(..) parameter syntax in favor of Jinja

Open davinov opened this issue 4 years ago • 1 comments

We actually support two syntax for variables that should be substituted in queries. This is probably one too much :p I suggest keeping Jinja only for clarity.

See this code where we already replace the param syntax by jinja: https://github.com/ToucanToco/toucan-connectors/pull/299/files#diff-0f79225d8a2288bbc6507d1647f4e5594e61b8284ca99c89759d678d7f3d3e87R79

davinov avatar Jan 20 '21 14:01 davinov

Points to take into consideration :

The syntaxes used in connectors out of our own implementation with Jinka is the one described here https://www.python.org/dev/peps/pep-0249/#paramstyle . It's what you'd find if you check the documentation of some connectors. (For instance, in Snowflake Connector, you find the pep 249 syntaxes described).

Otherwise using jinja syntax offers the advantage of being able to use nested params + we could have only one way of applying parameters.

hachichaud avatar Mar 17 '21 15:03 hachichaud