Skip to content
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

How to get Databricks kernel available also in the Interactive window #202

Closed
jaakko-paavola opened this issue Nov 14, 2024 · 8 comments
Closed

Comments

@jaakko-paavola
Copy link

Is there a way to have the Databricks kernel available also in the Interactive window in VsCode? Many people including myself like to use regular .py files + Interactive window instead of Notebook files. If there is some way, even if not fully supported/compatible, I would be glad to try it and report back here any issues I face.

@gbrueckl
Copy link
Collaborator

we had this implemented 1,5 years ago but it did not work properly - e.g. you could not use "Run Cell" from your code-cell but instead had to copy over the code to the interactive window which was not really usable

I will check how much work it will be to add this feature back to the current code base which has evolved a lot since then

@jaakko-paavola
Copy link
Author

The way I send code to the interactive window is by using the # %% cell markers in my .py file and then the key shortcuts "Jupyter: Run Current Cell And Advance" or "Jupyter: Run Current Cell" to send the cell where my cursor currently is, or alternatively just "Jupyter: Run Selection/Line in Interactive Window" to send the current line or whatever text I have selected. I believe this should all work in the exact same way if the Databricks kernel was available and selected in the interactive window instead of local kernel.

@gbrueckl
Copy link
Collaborator

so I found the discussion from back then microsoft/vscode-discussions#331

I also tried it again and the behavior is still the same
using an interactive kernel you could execute individual commands against a Databricks cluster but you could not use code-cells the way you can with local jupyter kernels

I updated the private build here to also include the interactive kernel
https://gbpublic001.blob.core.windows.net/files/databricks-vscode-2.3.6.vsix

pretty sure though it will not help you

@jaakko-paavola
Copy link
Author

Thanks!

Yes, I see now what you mean, but I'll use it nevertheless. It just adds the extra step of shifting the focus to the interactive window after sending code there and then executing the cell there "manually". A little inconvenience, but not a big deal in the way I'm working. The most important thing is that now I can work with .py files and send any arbitrary selection to be executed with the press of a key shortcut (+ the extra effort).

So thank you very much, hope you can keep this option open in the future official builds as well. I'll get back to you about the stability issue in the other thread.

@gbrueckl
Copy link
Collaborator

sure, the code is ready and I will just leave it in there
it should be updated automatically then once i publish the new version to the marketplace

@jkbnk
Copy link

jkbnk commented Dec 21, 2024

hi there!
i just wanted to thank you for the plugin in general...
and double thanks for this added functionality too. i am heavily used to REPL style work within interactive window and was missing it either in your extension or in databricks notebooks
i will be by pretty happy if the extension could implement automatic execution too. what would that entail? i have no idea how vs code extension development works...

@gbrueckl
Copy link
Collaborator

hi @jkbnk,

in one of my previous comments I referred to a discussion i started with the VSCode team where the technical details and limitations are explained. i am afraid I cannot really work around those barriers within our extension

@gbrueckl
Copy link
Collaborator

gbrueckl commented Jan 2, 2025

released v2.4.0 which now also includes the interactive kernel

@gbrueckl gbrueckl closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants