WIP: Add Connection Info Line Magic #742
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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
CHANGELOG.md
fileREADME.md
file