sparkmagic
sparkmagic copied to clipboard
Fix iteration over the sessions in /reconnectsparkmagic
Hi!
I noticed that the /reconnectsparkmagic endpoint was broken (with sparkmagic 0.15.0, iPython 7.16.1 and notebook 6.0.3).
I did an investigation and I found out that it was always recreating a new kernel because it could not correctly iterate over the different sessions to find to right kernel to restart.
So here is a small fix I made to make it work.
It seems to break the CI, I will do some further investigation to understand why.
The test is fixed. I had to create a new function _get_list_sessions that I mocked since I didn't find a way to correctly mock session_manager.list_sessions() with the new return format (source).
If you have a solution for mocking session_manager.list_sessions(), tell me :)
Hi @qlemaire22 thanks for making a PR! Is this fix still relevant? Can you provide instructions for reproducing the bug without this fix?