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

feat(magic): add run_personal and run_shared magic commands #50

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

nunogoncalves03
Copy link
Member

@nunogoncalves03 nunogoncalves03 commented Dec 9, 2024

This PR introduces the run_personal and run_shared magic commands. These commands are wrappers for downloading and executing a personal or shared file. After its execution, the local file created is deleted.

# Load commands
%load_ext singlestoredb.magics

# Line usage
%run_personal personal_file.ipynb
%run_personal {{ sample_notebook_name }}

%run_shared shared_file.ipynb
%run_shared {{ sample_notebook_name }}

cc: @ricardoasmarques @kanitsharma

@nunogoncalves03 nunogoncalves03 added the feature New feature or request label Dec 9, 2024
@nunogoncalves03 nunogoncalves03 self-assigned this Dec 9, 2024
@nunogoncalves03
Copy link
Member Author

How can we automatically load these commands on the notebook startup instead of executing %load_ext?

Copy link
Collaborator

@kesmit13 kesmit13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the sqlx magic used the top-level namespace, but I think we should avoid that here since these are very specific to SingleStore. I think we should add a magics subdirectory to singlestoredb and put all of our SingleStore-specific magics in that module and load them all at once (i.e., %load_ext singlestoredb.magics).

singlestoredb/magics/run_shared.py Outdated Show resolved Hide resolved
singlestoredb/magics/run_personal.py Outdated Show resolved Hide resolved
@kesmit13 kesmit13 merged commit 809f513 into main Dec 9, 2024
11 checks passed
@kesmit13 kesmit13 deleted the ngoncalves/run_files_magic_commands branch December 9, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants