-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Change cell delimiter? #48
Comments
I suspect this is due to an automated SQL formatter that collapses
I think this is a good suggestion. One additional consideration: there is some benefit to reducing the introduction of custom syntax because it keeps the UX of opening otherwise plain SQL files as notebooks functional. Specifically, if a user opens an existing SQL file I don't want a broken-by-default experience. Using this new delimiter would mean the default new experience would be one giant monolithic cell. One potential solution is to deserialize @jpmorris thoughts? |
I'll see what it is so particular about my workflow that I keep running into issues. It's not an easy issue to debug, but if I'm very careful to watch the file for changes as I use I agree Yeah I wouldn't have the serialize/deserialize operations be different. Maybe there's a way to allow for both parsings? Maybe a config in the UI to allow power users to use a standard (or specify their own) delimiter? Then the plugin would try its best to auto-cell any sql file that you throw at it, but it would allow us power users to force their cells where they like with complete control (and hopefully avoid multiple-editor, git issues). As an aside, if you're not aware, this question of "additional markup" must have been on the minds of the juypter folk too. But they made some poor choices in my mind that broke any version control and other important workflow (just parsing/cating files). So I think your intuition to build on top of standard plain sql files solid. Both Pycharm and VSCode have worked around juypter's file format issues by introducing their own parsing markup. Pycharm calls this scientific mode, and you can annotate any cell in a standard .py file (not .ipynb) you want with https://blog.jetbrains.com/pycharm/2018/04/pycharm-scientific-mode-with-code-cells/ VSCode Also adopted a similar convention with https://code.visualstudio.com/docs/python/jupyter-support-py This allows them to have a cell-based workflow without relying on Jupyter's horrible xml- (or json?)-based file format that is impossible to version control and gets you little (in my mind), since I believe both these workarounds still allow for markdown. I think they had to create a xml-based file format to retain output. But surely there was a better way to do this. Something that interpolates and segregates input and output and then let the application layer (and not the format) worry about the fancy graphs and output. (I don't see how dynamic code-block insertion doesn't solve all of juypter's fancy output requirements; and any app could take care of that presentation-layer rather than be a format parser.) By segregating input/output you wouldn't give another reason for us who work with personal data another reason to scrap the jupyter format. Maybe, some things to think about (esp because I see you are getting requests to retain output). |
My apologies for the delayed response. @jpmorris lots of great thinking there, I appreciate the depth.
This is a good suggestion, but thinking through the implementation details, I think it would add unnecessary complexity for the user. Consider the UX of opening a shared notebook with a collaborator
Upon further rumination, I think you're correct. And since a configurable delimiter isn't worth the UX overhead for the reasons listed above, I think the best path forward is to replace the current Of course, this will collapse all existing sql notebooks into a single cell. So long as we call out this breaking change in the changelog, I think it's fine. We can even provide a little bash command in the release notes that will replace all instances of |
Yes if you want to pick a standard then I would say that's better than user customization. I would only say that user-defined delimiter is better keeping it ONLY Part of the reason the issue you raised is because there's no standard here. If there was a standard then people would mostly abide by that standard. (User-defined delimiter would also probably be unnecessary, or if there were 2 standards--like line endings or tab v space, or even auto-formatters (like python black)--the config would be a simple dropdown like many of the settings in vscode UI.) I think Thanks for all the hard work and continual development on this. Do you have a tip jar someone can donate to? |
I know it may break earlier code, but is there anyway we can change the cell delimiter to something else besides
/n/n
?Two newlines is very common, things shift, and I think this (along with accidently opening as a normal sql txt) seem to be causing an error that my cells are CONSTANTLY collapsing into one monolithic cell. (Also I suspect that it may be introducing merge conflicts when I rebase.)
Wouldn't something like:
--#vscode-sql-notebook
or anything really that would help retain cell formatting after presses, pushed and pulled from repos and opening in other editors.
The text was updated successfully, but these errors were encountered: