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

WIP: Add Connection Info Line Magic #742

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

walarue
Copy link

@walarue walarue commented Dec 16, 2021

Description

This PR is WIP -- unit tests coming shortly, wanted to sanity check the general approach and see if this makes sense at all. The motivation is this issue: #468

It adds a %connection_info line magic that prints the current endpoint and session id, or (more importantly) returns them as a dict when the -o option is used:

{
	"endpoint": "http://<ip>:8998",
	"session": "<session_id>"
}

The idea here is enabling users to use the livy API with the current session. There are some livy endpoints, like the one to upload code packages, that aren't part of sparkmagic (as far as I can tell) and there could always be more in the future. It could be useful to make the connection info available in code so users can make calls to them.

While %%info nicely formats and prints a lot of this information I can't get the information in code, which means I couldn't use it programmatically and have to copy paste from the %%info output.

Checklist

  • Wrote a description of my changes above
  • Added a bullet point for my changes to the top of the CHANGELOG.md file
  • Added or modified unit tests to reflect my changes
  • Manually tested with a notebook
  • If adding a feature, there is an example notebook and/or documentation in the README.md file

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

Successfully merging this pull request may close these issues.

1 participant