Skip to main content

Code Generation

Generate Python or SQL code for data processing.

Step 1: Select Type

  1. Select the Code card.
  2. Choose a language.
    • Python: Implement complex logic such as data frame processing
    • SQL: Write data query and aggregation queries

Step 2: Basic Info

  • Name: Code name (required)
  • Packages (Python only): List of required libraries (e.g., pandas, numpy)
  • Description, Tags, and other metadata fields

Step 3: Code Content

[Screenshot] Code editor screen in the code generation wizard (with AI inline chat popup activated)

Use the built-in code editor to write your logic.

AI Code Assistant

The editor includes a powerful AI coding assistant.

  • Inline Chat: Press Ctrl+I (or Cmd+I) to request code from AI using natural language.
    • Example: "Remove null values from the input data and sort by date"
  • Code Explanation: Select written code and ask AI for an explanation.

Default Templates

When you select a language, template code with a basic execution structure is automatically provided.

Python Example:

def run(input, options):
# input: Input dataframe
# Write your logic here
return {"output": input}

SQL Example:

SELECT * FROM input

Completion

Once code writing is complete, click the Create (or Submit Code) button to save the code.