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 0x0000017357306890>
table_enable_filter: bool = <ast.Call object at 0x00000173573066E0>
table_enable_sort: bool = <ast.Call object at 0x0000017357306530>
table_enable_group: bool = <ast.Call object at 0x0000017357306380>
table_enable_set_all_rows: bool = <ast.Call object at 0x00000173573061D0>
slider_range: bool = <ast.Call object at 0x0000017357306020>
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 0x0000017357305D50>
description: str | None = <ast.Call object at 0x0000017357305B40>
default: Any = <ast.Call object at 0x0000017357305990>
required: bool = <ast.Call object at 0x00000173573057E0>
selections: list[Any] | None = <ast.Call object at 0x0000017357305570>
selections_name: list[str] | None = <ast.Call object at 0x0000017357305300>
placeholder: str | None = <ast.Call object at 0x00000173573050F0>
help_text: str | None = <ast.Call object at 0x0000017357304EE0>
units: Units | None = <ast.Call object at 0x0000017357304CD0>
depends_on: list[str] | str | None = <ast.Call object at 0x0000017357304A00>
visible: bool = <ast.Call object at 0x0000017357304850>
readonly: bool = <ast.Call object at 0x00000173573046A0>
widget_attributes: WidgetAttribute = <ast.Call object at 0x00000173573044F0>
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 type is not set, it will be automatically determined based on the selections and max_length. If the selections is not set, it will be automatically determined based on the max_length.

Attributes:

vtype: Literal[string] = <ast.Call object at 0x00000173573041F0>
min_length: int | None = <ast.Call object at 0x00000173572FBFA0>
max_length: int | None = <ast.Call object at 0x00000173572FBD90>
pattern: str | None = <ast.Call object at 0x00000173572FBB80>
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 type is not set, it will be automatically determined based on the selections.

Attributes:

vtype: Literal[integer] = <ast.Call object at 0x00000173573EC850>
minimum: int | None = <ast.Call object at 0x00000173573ED750>
maximum: int | None = <ast.Call object at 0x00000173573ED360>
exclude_minimum: bool = <ast.Call object at 0x00000173573ED5D0>
exclude_maximum: bool = <ast.Call object at 0x00000173573ED150>
multiple_of: int | None = <ast.Call object at 0x00000173573ED000>
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 type is not set, it will be automatically determined based on the selections.

Attributes:

vtype: Literal[float] = <ast.Call object at 0x00000173573EF9D0>
minimum: float | None = <ast.Call object at 0x00000173573EFE50>
maximum: float | None = <ast.Call object at 0x000001735726F010>
exclude_minimum: bool = <ast.Call object at 0x000001735726ED40>
exclude_maximum: bool = <ast.Call object at 0x000001735726EE30>
multiple_of: float | None = <ast.Call object at 0x000001735726EBF0>
precision: int | None = <ast.Call object at 0x000001735726E2F0>
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 type is not set, it will be automatically determined.

Attributes:

vtype: Literal[boolean] = <ast.Call object at 0x000001735726CE80>
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 0x00000173572017E0>
items: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x0000017357202620>
min_items: int = <ast.Call object at 0x00000173572026E0>
max_items: int | None = <ast.Call object at 0x00000173572030A0>
unique_items: bool = <ast.Call object at 0x0000017357202440>
render_as_table: bool = <ast.Call object at 0x0000017357202500>
class pipeline.pipeData.ui_schema.ObjectAttributeSchema

Object attribute schema.

Inherits from:

BaseAttributeSchema

Attributes:

vtype: Literal[object] = <ast.Call object at 0x000001735722BB80>
properties: dict[(str, StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | FileAttributeSchema)] = <ast.Call object at 0x000001735721EDA0>
additional_properties: bool = <ast.Call object at 0x000001735721EAA0>
additional_properties_key_schema: StringAttributeSchema | IntegerAttributeSchema | None = <ast.Call object at 0x000001735721F2E0>
additional_properties_value_schema: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | None = <ast.Call object at 0x000001735721D810>
class pipeline.pipeData.ui_schema.FileAttributeSchema

File attribute schema.

Inherits from:

BaseAttributeSchema

Properties:

widget

Attributes:

vtype: Literal[gdim_file] = <ast.Call object at 0x000001735721F370>
extension: str | list[str] | None = <ast.Call object at 0x000001735721E4D0>
upload: bool = <ast.Call object at 0x000001735721C430>
min_files: int = <ast.Call object at 0x000001735721C100>
max_files: int | None = <ast.Call object at 0x000001735721F3A0>
directory: bool = <ast.Call object at 0x000001735721E980>
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 0x000001735721E8F0>
columns: list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | FileAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x000001735721C970>
columns_name: list[str] = <ast.Call object at 0x000001735721CE20>
min_rows: int = <ast.Call object at 0x000001735721C0A0>
max_rows: int | None = <ast.Call object at 0x000001735721EFE0>
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 UIAttributeSchema entry — it cannot be nested inside ObjectAttributeSchema, ArrayAttributeSchema, or TableAttributeSchema.

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 0x000001735723EA70>
title: str | None = <ast.Call object at 0x000001735723E290>
description: str | None = <ast.Call object at 0x000001735723F2B0>
default: Any = <ast.Call object at 0x000001735723F310>
required: bool = <ast.Call object at 0x000001735723DA20>
help_text: str | None = <ast.Call object at 0x000001735723FEE0>
depends_on: list[str] | str | None = <ast.Call object at 0x000001735723F460>
visible: bool = <ast.Call object at 0x000001735723F9D0>
readonly: bool = <ast.Call object at 0x000001735723FD30>
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 0x000001735723F4C0>
default: Any = <ast.Call object at 0x0000017357220820>
value_type: Literal[(str, int, float, bool, list[str], list[int], list[float])] = <ast.Call object at 0x0000017357223820>
schema_type: Literal[(auto_select, auto_range)] = <ast.Call object at 0x0000017357220B80>
include_min: bool = <ast.Call object at 0x00000173572227D0>
include_max: bool = <ast.Call object at 0x0000017357222D10>
min_items: int = <ast.Call object at 0x0000017357222BC0>
max_items: int | None = <ast.Call object at 0x0000017357222200>
visible: bool = <ast.Call object at 0x0000017357223BE0>
readonly: bool = <ast.Call object at 0x0000017357220790>
depends_on: list[str] | str | None = <ast.Call object at 0x0000017357222A40>
select_enable_search: bool = <ast.Call object at 0x0000017357220370>