jupyter-incubator / sparkmagic

Jupyter magics and kernels for working with remote Spark clusters
Other
1.33k stars 447 forks source link

Is there any way to restart sparkmagic kernel on jupyter notebook using code? #764

Closed treyyi closed 2 years ago

treyyi commented 2 years ago

Hi all,

I'm wondering if there's any way to restart sparkmagic kernel on jupyter notebook using code.

If not, any work-around would be very helpful. Thanks for your support in advance.

devstein commented 2 years ago

Hi @TreyYi programmatically restarting a Jupyter kernel is not unique to the Sparkmagic kernel, so I would suggest googling around for a general answer for any kernel. Let me know what you find!

One way to do it that is unique to Sparkmagic is the %%configure -f magic. People often use %%configure -f to use different Spark sessions for different sections of the notebook.