Skip to main content

Code Generation and Editing

D.Hub's code editor (Template Wizard, Pipeline Code Node, etc.) includes a built-in AI coding assistant, making it easy for users unfamiliar with programming to implement logic.

AI Code Generation

[Screenshot] AI code generation prompt screen

AI Code Generation

Useful when writing new code from scratch.

  1. Click the AI button in the code editor toolbar or press the shortcut Cmd+I (Mac) / Ctrl+I (Windows).
  2. Describe the desired logic in natural language in the prompt window.
    • Example: "Filter only rows where 'status' is 'active' from the input data, and count by date."
  3. Click the Generate button and AI will write the code and show a preview.
  4. If you're satisfied with the code, click Accept to apply it to the editor.

Supported Languages and Guidelines

  • Python: Optimized for data frame processing using the polars library. Automatically follows the input (inputs) and output (output) dictionary structure.
  • SQL: Supports standard SQL syntax and appropriately maps input table names.

Inline AI Edit

[Screenshot] AI inline edit screen

AI Inline Edit

Use this when modifying or improving existing code.

  1. Drag to select the code area you want to modify in the editor.
  2. Click the AI Edit button that appears near the selection or press the shortcut Cmd+I / Ctrl+I.
  3. Enter your modification request.
    • Example: "Change the variable names to be more intuitive", "Add error handling to this section"
  4. Review the changes suggested by AI (Diff View) and apply them.