-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #5877] Support Python magic syntax for notebook usage
# 🔍 Description ## Issue References 🔗 Support python magic syntax, for example: ``` %table %json %matplot ``` Refer: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-magics.html https://github.com/jupyter-incubator/sparkmagic https://github.com/apache/incubator-livy/blob/master/repl/src/main/resources/fake_shell.py This pull request fixes #5877 ## Describe Your Solution 🔧 Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 Testing with python code: ``` import matplotlib.pyplot as plt plt.plot([3,4,5],[6,7,8]) %matplot plt; ``` <img width="1723" alt="image" src="https://github.com/apache/kyuubi/assets/6757692/9a1176c0-8eb0-4a64-83e4-35e74e33d2f0"> Decode the "image/png" and save to png. ![matplot](https://github.com/apache/kyuubi/assets/6757692/9139f9d3-7822-43b0-8959-261ed8e79d22) #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklists ## 📝 Author Self Checklist - [ ] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project - [ ] I have performed a self-review - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) ## 📝 Committer Pre-Merge Checklist - [ ] Pull request title is okay. - [ ] No license issues. - [ ] Milestone correctly set? - [ ] Test coverage is ok - [ ] Assignees are selected. - [ ] Minimum number of approvals - [ ] No changes are requested **Be nice. Be informative.** Closes #5881 from turboFei/magic_command. Closes #5877 6f2b193 [Fei Wang] ut 877c7d1 [Fei Wang] internal config 012dfe4 [Fei Wang] nit 3e0f324 [Fei Wang] except other exceptions 24352d2 [Fei Wang] raise execution error 0853161 [Fei Wang] raise ExecutionError instead of execute_reply_error c058def [Fei Wang] add more ut 4da5215 [Fei Wang] Dumps python object to json at last 3512753 [Fei Wang] add ut for json and table 48735eb [Fei Wang] the data should be Map[String, Object] 3a3ba0a [Fei Wang] return other data fields 54d6800 [Fei Wang] reformat 87ded6e [Fei Wang] add config to disable 44f88ef [Fei Wang] add magic node back Authored-by: Fei Wang <[email protected]> Signed-off-by: Fei Wang <[email protected]>
- Loading branch information
Showing
4 changed files
with
312 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.