jupysql
jupysql copied to clipboard
Auto-format plugins don't work for SQL in Jupyter notebooks
What happens?
Hi! This has been an amazing teaching tool.
Unfortunately we are unable to figure out how to debug Visual Studio Code formatting extensions to have them work in cells decorated with %%sql cell magics. E.g. this extension doesn't work: https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.duckdb-sql-tools nor other formatters.
P.S. Fun anecdote, last year I started my class at Princeton with this notebook + Jupysql: https://github.com/onefact/datathinking.org-codespace/blob/main/notebooks/princeton-university/week-1-visualizing-33-million-phone-calls-in-new-york-city.ipynb
Now Motherduck has used the same dataset + SQL code written thanks to this in their blog! https://motherduck.com/blog/introducing-column-explorer/
To Reproduce
Try to use the formatting shortcut, alt + cmd + f to format, and nothing happens.
OS:
MacOS
JupySQL Version:
Latest
Full Name:
Dr. Jaan Lı
Affiliation:
University of Tartu / One Fact Foundation
Hi, I'm unsure about the issue you're reporting. It sounds like a VSCode question (?)
Yes I think so! Thank you @edublancas - what formatter would you recommend for JupySQL cells?
I only use JupySQL via Jupyter, so I don't know if there is any VSCode extension that works.
Ah okay - this is via Jupyter as well; sorry for being unclear.
How would you recommend using a formatter in Jupyter, independent of Visual Studio Code? I can reproduce this issue in the Jupyter notebook interface, in a Colaboratory notebook, or WASM Jupyter notebook if needed 🙏