jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
620 stars 223 forks source link

Ensure kernel session retrieve from resp is correct type #1147

Closed chiawchen closed 2 years ago

chiawchen commented 2 years ago

In load_sessions(), we need to traverse an iterable list kernel_sessions to get kernel_session . However if we retrieve the response with response.content, it actually give us back byte string, and leads to iterate on byte char instead of a dict object. Therefore, this PR address the improper used content to json() and rm the json.loads() part in _load_session_from_response

[Test Plan] Having a customized WebhookKernelSessionManager deploy on Kubernetes and works properly with these changes.

welcome[bot] commented 2 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] commented 2 years ago

Congrats on your first merged pull request in this project! :tada: congrats Thank you for contributing, we are very proud of you! :heart: