instacart / instacart/lore

Broken jinja2 templating in snowflake sql

Open
#168 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.5k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Currently, Jinja2 templating is done here:

https://github.com/instacart/lore/blob/f4789b1439801cd5171df69d0d63d12060b52999/lore/io/connection.py#L413-L434

And this is how they are called:

https://github.com/instacart/lore/blob/f4789b1439801cd5171df69d0d63d12060b52999/lore/io/connection.py#L168-L169

The problem here is all the args are passed twice, one to jinja2, the other to snowflake connector.

It will break down right here, because nothing could be formated this way.

For example if we want to run

```
lore.io.analysis.execute(filename='somefile', job_type=self.job_type)
```

we will see `processed_params` is not empty and breaks the program here:

https://github.com/snowflakedb/snowflake-connector-python/blob/83dfe771c5404657f2008fec15bf0386185b6d70/cursor.py#L491

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.