pipeline.pipeData.ui_schema
UI schema models for defining module parameter widgets and validation.
Classes
- class pipeline.pipeData.ui_schema.WidgetAttribute
Widget attribute.
- Inherits from:
BaseModel
Attributes:
- select_enable_search: bool = <ast.Call object at 0x0000028E2175E8C0>
- table_enable_filter: bool = <ast.Call object at 0x0000028E2175E710>
- table_enable_sort: bool = <ast.Call object at 0x0000028E2175E560>
- table_enable_group: bool = <ast.Call object at 0x0000028E2175E3B0>
- table_enable_set_all_rows: bool = <ast.Call object at 0x0000028E2175E200>
- slider_range: bool = <ast.Call object at 0x0000028E2175E050>
- class pipeline.pipeData.ui_schema.BaseAttributeSchema
Base attribute schema for all kinds of attributes.
- Inherits from:
BaseModel
Attributes:
- title: str | None = <ast.Call object at 0x0000028E2175DD80>
- description: str | None = <ast.Call object at 0x0000028E2175DB70>
- default: Any = <ast.Call object at 0x0000028E2175D9C0>
- required: bool = <ast.Call object at 0x0000028E2175D810>
- selections: list[Any] | None = <ast.Call object at 0x0000028E2175D5A0>
- selections_name: list[str] | None = <ast.Call object at 0x0000028E2175D330>
- placeholder: str | None = <ast.Call object at 0x0000028E2175D120>
- help_text: str | None = <ast.Call object at 0x0000028E2175CF10>
- units: Units | None = <ast.Call object at 0x0000028E2175CD00>
- depends_on: list[str] | str | None = <ast.Call object at 0x0000028E2175CA30>
- visible: bool = <ast.Call object at 0x0000028E2175C880>
- readonly: bool = <ast.Call object at 0x0000028E2175C6D0>
- widget_attributes: WidgetAttribute = <ast.Call object at 0x0000028E2175C520>
- class pipeline.pipeData.ui_schema.StringAttributeSchema
String attribute schema.
- Inherits from:
BaseAttributeSchema
Methods:
Properties:
- widget
Get the widget type of the attribute.
If the
widget typeis not set, it will be automatically determined based on theselectionsandmax_length. If theselectionsis not set, it will be automatically determined based on themax_length.
Attributes:
- vtype: Literal[string] = <ast.Call object at 0x0000028E2175C220>
- min_length: int | None = <ast.Call object at 0x0000028E222E0AF0>
- max_length: int | None = <ast.Call object at 0x0000028E222E0160>
- pattern: str | None = <ast.Call object at 0x0000028E222E0460>
- class pipeline.pipeData.ui_schema.IntegerAttributeSchema
Integer attribute schema.
- Inherits from:
BaseAttributeSchema
Methods:
Properties:
- widget
Get the widget type of the attribute.
If the
widget typeis not set, it will be automatically determined based on theselections.
Attributes:
- vtype: Literal[integer] = <ast.Call object at 0x0000028E222E7E20>
- minimum: int | None = <ast.Call object at 0x0000028E222E79D0>
- maximum: int | None = <ast.Call object at 0x0000028E222E7070>
- exclude_minimum: bool = <ast.Call object at 0x0000028E222E5990>
- exclude_maximum: bool = <ast.Call object at 0x0000028E222E57E0>
- multiple_of: int | None = <ast.Call object at 0x0000028E222E55D0>
- class pipeline.pipeData.ui_schema.FloatAttributeSchema
Float attribute schema.
- Inherits from:
BaseAttributeSchema
Methods:
Properties:
- widget
Get the widget type of the attribute.
If the
widget typeis not set, it will be automatically determined based on theselections.
Attributes:
- vtype: Literal[float] = <ast.Call object at 0x0000028E222E4400>
- minimum: float | None = <ast.Call object at 0x0000028E222E41F0>
- maximum: float | None = <ast.Call object at 0x0000028E22212320>
- exclude_minimum: bool = <ast.Call object at 0x0000028E22212170>
- exclude_maximum: bool = <ast.Call object at 0x0000028E22211FC0>
- multiple_of: float | None = <ast.Call object at 0x0000028E22211DB0>
- precision: int | None = <ast.Call object at 0x0000028E22211BA0>
- class pipeline.pipeData.ui_schema.BooleanAttributeSchema
Boolean attribute schema.
- Inherits from:
BaseAttributeSchema
Methods:
Properties:
- widget
Get the widget type of the attribute.
If the
widget typeis not set, it will be automatically determined.
Attributes:
- vtype: Literal[boolean] = <ast.Call object at 0x0000028E222109A0>
- class pipeline.pipeData.ui_schema.ArrayAttributeSchema
Array attribute schema.
Notes
If the widget type of the ArrayAttributeSchema is ``select`` or ``checkbox``, it will be a multi-select widget.
- Inherits from:
BaseAttributeSchema
Methods:
Properties:
- widget
Get the widget type for array attributes.
Attributes:
- vtype: Literal[array] = <ast.Call object at 0x0000028E2171AC50>
- items: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x0000028E216F2E30>
- min_items: int = <ast.Call object at 0x0000028E216F1E40>
- max_items: int | None = <ast.Call object at 0x0000028E216F32E0>
- unique_items: bool = <ast.Call object at 0x0000028E216F32B0>
- render_as_table: bool = <ast.Call object at 0x0000028E216F1F90>
- class pipeline.pipeData.ui_schema.ObjectAttributeSchema
Object attribute schema.
- Inherits from:
BaseAttributeSchema
Attributes:
- vtype: Literal[object] = <ast.Call object at 0x0000028E216F2830>
- properties: dict[(str, StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | FileAttributeSchema)] = <ast.Call object at 0x0000028E21725AB0>
- additional_properties: bool = <ast.Call object at 0x0000028E217244F0>
- additional_properties_key_schema: StringAttributeSchema | IntegerAttributeSchema | None = <ast.Call object at 0x0000028E217248E0>
- additional_properties_value_schema: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | None = <ast.Call object at 0x0000028E21725540>
- class pipeline.pipeData.ui_schema.FileAttributeSchema
File attribute schema.
- Inherits from:
BaseAttributeSchema
Properties:
- widget
Attributes:
- vtype: Literal[gdim_file] = <ast.Call object at 0x0000028E21726320>
- extension: str | list[str] | None = <ast.Call object at 0x0000028E21724D30>
- upload: bool = <ast.Call object at 0x0000028E21726560>
- min_files: int = <ast.Call object at 0x0000028E217260B0>
- max_files: int | None = <ast.Call object at 0x0000028E21724FA0>
- directory: bool = <ast.Call object at 0x0000028E21726080>
- class pipeline.pipeData.ui_schema.TableAttributeSchema
Table attribute schema.
- Inherits from:
BaseAttributeSchema
Methods:
- validate_columns_length() TableAttributeSchema
Validate that columns_name has the same length as columns.
Properties:
- widget
Attributes:
- vtype: Literal[table] = <ast.Call object at 0x0000028E21724790>
- columns: list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | FileAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x0000028E217268F0>
- columns_name: list[str] = <ast.Call object at 0x0000028E21724B80>
- min_rows: int = <ast.Call object at 0x0000028E21725F60>
- max_rows: int | None = <ast.Call object at 0x0000028E21725E40>
- class pipeline.pipeData.ui_schema.CustomAttributeSchema
Custom UI attribute schema.
Signals that the frontend must not auto-generate a widget from this schema. Instead, frontend and pipeline developers coordinate out-of-band to define what value shape to assign to the pipeline attribute.
This schema is intended for one-shot or bespoke UI integrations (e.g. map pickers, domain-specific editors). It is only valid as a top-level
UIAttributeSchemaentry — it cannot be nested insideObjectAttributeSchema,ArrayAttributeSchema, orTableAttributeSchema.Notes
- ``default`` provides an example payload or initial value; it does not define a machine-readable validation schema. - Value-shape validation is the responsibility of the pipeline module, not the UI schema layer. - The frontend should render a custom component agreed upon with the pipeline developer; widget-related fields from other schema types are intentionally omitted here.
- Inherits from:
BaseModel
Attributes:
- vtype: Literal[custom] = <ast.Call object at 0x0000028E2170FA60>
- title: str | None = <ast.Call object at 0x0000028E2170FCA0>
- description: str | None = <ast.Call object at 0x0000028E2170DFC0>
- default: Any = <ast.Call object at 0x0000028E2170DDE0>
- required: bool = <ast.Call object at 0x0000028E2170C0A0>
- help_text: str | None = <ast.Call object at 0x0000028E2170E440>
- depends_on: list[str] | str | None = <ast.Call object at 0x0000028E2170E110>
- visible: bool = <ast.Call object at 0x0000028E2170D600>
- readonly: bool = <ast.Call object at 0x0000028E2170ED10>
- class pipeline.pipeData.ui_schema.TemplateVariableConfig
Configuration for auto-generated UI schemas for template variables.
This model defines how a variable placeholder in a query template should be handled, including its UI schema generation strategy. The column name for auto-select/auto-range is automatically parsed from the query template.
For explicit UI schema control, use UIAttributeSchema directly in the template_variables dictionary instead of TemplateVariableConfig.
Template Syntax Variables use {variable_name} placeholders. String values are auto-quoted based on value_type:
"``年份== {tpl_year}”`` with value_type=”int” →年份== 2007"``国家== {tpl_country}”`` with value_type=”str” →国家== ‘US’
Examples
>>> # Auto-select from unique column values >>> year_config = TemplateVariableConfig( ... title="年份", ... default=2007, ... value_type="int", ... schema_type="auto_select", ... ) >>> # Auto-range for numeric values (slider/number input with min/max) >>> depth_config = TemplateVariableConfig( ... title="深度", ... default=10.0, ... value_type="float", ... schema_type="auto_range", ... ) >>> # Multi-select from unique column values (for ``in`` queries) >>> # e.g., query_template="``年份`` in {tpl_years}" >>> years_config = TemplateVariableConfig( ... title="年份", ... default=[2007, 2008], ... value_type="list[int]", ... schema_type="auto_select", ... min_items=1, ... max_items=5, ... ) >>> # For explicit schema, use UIAttributeSchema directly: >>> # template_variables = { >>> # "tpl_status": StringAttributeSchema( >>> # title="状态", >>> # default="active", >>> # selections=["active", "inactive"], >>> # ) >>> # }
- Inherits from:
BaseModel
Methods:
- validate_schema_value_type_compatibility() TemplateVariableConfig
Validate that schema_type and value_type are compatible.
auto_range only supports numeric types: int, float
auto_select supports all types including list types
Attributes:
- title: str = <ast.Call object at 0x0000028E2170E8C0>
- default: Any = <ast.Call object at 0x0000028E21713520>
- value_type: Literal[(str, int, float, bool, list[str], list[int], list[float])] = <ast.Call object at 0x0000028E21712950>
- schema_type: Literal[(auto_select, auto_range)] = <ast.Call object at 0x0000028E21713670>
- include_min: bool = <ast.Call object at 0x0000028E21713640>
- include_max: bool = <ast.Call object at 0x0000028E21712D70>
- min_items: int = <ast.Call object at 0x0000028E21712860>
- max_items: int | None = <ast.Call object at 0x0000028E217123B0>
- visible: bool = <ast.Call object at 0x0000028E21710760>
- readonly: bool = <ast.Call object at 0x0000028E217101F0>
- depends_on: list[str] | str | None = <ast.Call object at 0x0000028E21710340>
- select_enable_search: bool = <ast.Call object at 0x0000028E21712F50>