sparkmagic icon indicating copy to clipboard operation
sparkmagic copied to clipboard

Fix iteration over the sessions in /reconnectsparkmagic

Open qlemaire22 opened this issue 5 years ago • 3 comments

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.

qlemaire22 avatar Jul 27 '20 13:07 qlemaire22

It seems to break the CI, I will do some further investigation to understand why.

qlemaire22 avatar Jul 27 '20 14:07 qlemaire22

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 :)

qlemaire22 avatar Jul 28 '20 08:07 qlemaire22

Hi @qlemaire22 thanks for making a PR! Is this fix still relevant? Can you provide instructions for reproducing the bug without this fix?

devstein avatar Jun 05 '21 19:06 devstein