fix issue 194

pull/192/head
Jens Albrecht 2021-05-02 16:20:46 +02:00
parent e608279083
commit 805e428423
1 changed files with 5 additions and 3 deletions

View File

@ -148,9 +148,11 @@ class SqlMagic(Magics, Configurable):
"""
# Parse variables (words wrapped in {}) for %%sql magic (for %sql this is done automatically)
cell_variables = [
fn for _, fn, _, _ in Formatter().parse(cell) if fn is not None
]
# possible fix to issue #194 https://github.com/catherinedevlin/ipython-sql/issues/194
cell_variables = re.findall(r"{(\w+)}", cell)
# cell_variables = [
# fn for _, fn, _, _ in Formatter().parse(cell) if fn is not None
# ]
cell_params = {}
for variable in cell_variables:
if variable in local_ns: