Notebook files in DataBuddy Studio use .ipynb as the extension and organize code by cells. This section describes the basic capabilities of the Notebook editor, including Cell management, multi-language switching, multi-user collaboration, and version management. For run-related content, see Notebook Run. Overview
Notebook IDE provides a development experience similar to Jupyter Notebook:
The default cell language is Python. You can switch to SQL, Markdown, and other syntaxes by using magic commands.
Cells support operations such as creating, moving up, moving down, deleting, and hiding run results.
Multi-user collaboration is supported. In multi-user editing scenarios, a prompt feature is provided, and you can view the list of editors for the current file.
Files support manual saving and version management, with up to 200 saved versions retained.
Prerequisites
You have joined the workspace and have Edit or Manage permission on the current Notebook file.
You have created or own an accessible Notebook file.
Operation Steps
Step 1: Opening or Creating a Notebook File
1. In the Development Directory on the left side of Studio:
Click an existing .ipynb file to open it directly.
Alternatively, choose + New > Notebook, enter a file name, select a parent folder, and then click OK.
2. The file is opened as a Tab in the editor on the right.
Step 2: Managing Cells
The toolbar + Code/Text supports adding cells of the following types:
Type | Description |
Code | Defaults to Python syntax and supports switching to SQL syntax. |
Text | Used for writing descriptive text and supports full Markdown syntax. |
The following quick operations are supported for each cell:
Operation | Description |
Run Cell | Supports running the current cell, all cells above, and the current cell and below. |
Move Up / Move Down | Adjust cell order. |
Hide Result | Collapse the cell result display area. |
Deleting an alarm policy | Delete the current cell. |
Step 3: Switching Syntax via Magic Commands
Use a magic command in the first line of a Python cell to switch the language of that cell:
Magic commands | Syntax after switching |
%sql
| Spark SQL |
%md
| Markdown |
%scala
| Scala |
%sql
SELECT * FROM your_catalog.your_schema.your_table LIMIT 10;
Note:
A magic command takes effect only for the current cell. After the syntax is switched, the code in that cell is executed by the corresponding interpreter.
Step 4: Using Code Completion and Syntax Checking
Auto-completion: When you enter database, table, view, field, or function names, the editor provides completion suggestions based on the bound data catalog. When you enter Python library names (such as pandas and numpy), it also displays common APIs.
Syntax check: During editing, the cell highlights issues such as Python syntax errors, indentation errors, and undefined variables, and displays a red wavy line on the left side of the line with the error.
Bracket matching: Automatically pairs (), [], {}, single quotes, and double quotes.
Step 5: Saving and Viewing Versions
Auto-save: Automatically saves when you leave the editor or at scheduled intervals. The latest draft is automatically restored when you reopen the file.
Manual save: Click Save in the toolbar or use the shortcut key ⌘ + S to generate a version record.
View versions: View historical versions in the Version Management drawer on the right. Each version displays the version number, saved by, save time, and description.
Version comparison and rollback: Select two versions to compare their differences, or select a historical version to perform a rollback.
Note:
Up to 200 manual versions are retained. When the limit is exceeded, the earliest versions are overwritten first.
Step 6: Multi-Person Collaboration
When user A opens a file and enters the editing state, if another user B is editing the same Cell, the system displays the list of current editors in the upper-right corner of the Cell to alert users and reduce the risk of overwriting each other's changes.
Parameter Description
Notebook Keyboard Shortcuts (Mac Key Bindings)
Shortcut Keys | Operation |
Y
| Switch to Code Cell |
M
| Switch to Markdown Cell |
D, D
| Delete Current Cell. |
⌘ + Enter
| Run Current Cell. |
⇧ + Enter
| Run Current Cell and Select Next. |
Windows users should replace ⌘ with Ctrl and ⇧ with Shift.
File Types That Support Version Management
.ipynb / .py / .sql / .r / .scala / .sh / .json / .yaml / .yml / .md / .txt / .csv
Use Limits
A single file can retain up to 200 manual versions. Auto-saved content is not counted as a version.
References