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 0x0000021FE18F28C0>
table_enable_filter: bool = <ast.Call object at 0x0000021FE18F2710>
table_enable_sort: bool = <ast.Call object at 0x0000021FE18F2560>
table_enable_group: bool = <ast.Call object at 0x0000021FE18F23B0>
table_enable_set_all_rows: bool = <ast.Call object at 0x0000021FE18F2200>
slider_range: bool = <ast.Call object at 0x0000021FE18F2050>
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 0x0000021FE18F1D80>
description: str | None = <ast.Call object at 0x0000021FE18F1B70>
default: Any = <ast.Call object at 0x0000021FE18F19C0>
required: bool = <ast.Call object at 0x0000021FE18F1810>
selections: list[Any] | None = <ast.Call object at 0x0000021FE18F15A0>
selections_name: list[str] | None = <ast.Call object at 0x0000021FE18F1330>
placeholder: str | None = <ast.Call object at 0x0000021FE18F1120>
help_text: str | None = <ast.Call object at 0x0000021FE18F0F10>
units: Units | None = <ast.Call object at 0x0000021FE18F0D00>
depends_on: list[str] | str | None = <ast.Call object at 0x0000021FE18F0A30>
visible: bool = <ast.Call object at 0x0000021FE18F0880>
readonly: bool = <ast.Call object at 0x0000021FE18F06D0>
widget_attributes: WidgetAttribute = <ast.Call object at 0x0000021FE18F0520>
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 0x0000021FE18F0220>
min_length: int | None = <ast.Call object at 0x0000021FE1897F10>
max_length: int | None = <ast.Call object at 0x0000021FE1897970>
pattern: str | None = <ast.Call object at 0x0000021FE1897940>
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 0x0000021FE0DCAA70>
minimum: int | None = <ast.Call object at 0x0000021FE0DC9D20>
maximum: int | None = <ast.Call object at 0x0000021FE0DCA230>
exclude_minimum: bool = <ast.Call object at 0x0000021FE0DC9A80>
exclude_maximum: bool = <ast.Call object at 0x0000021FE0DC9960>
multiple_of: int | None = <ast.Call object at 0x0000021FE0DC9570>
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 0x0000021FE0DC8E20>
minimum: float | None = <ast.Call object at 0x0000021FE0DC85B0>
maximum: float | None = <ast.Call object at 0x0000021FE0DFBA00>
exclude_minimum: bool = <ast.Call object at 0x0000021FE0DFBF70>
exclude_maximum: bool = <ast.Call object at 0x0000021FE0DFBE50>
multiple_of: float | None = <ast.Call object at 0x0000021FE0DFB910>
precision: int | None = <ast.Call object at 0x0000021FE0DFB430>
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 0x0000021FE0DF9870>
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 0x0000021FE0DC1AB0>
items: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x0000021FE0DC3010>
min_items: int = <ast.Call object at 0x0000021FE0DC2470>
max_items: int | None = <ast.Call object at 0x0000021FE0DC21D0>
unique_items: bool = <ast.Call object at 0x0000021FE0DC1660>
render_as_table: bool = <ast.Call object at 0x0000021FE0DC3460>
class pipeline.pipeData.ui_schema.ObjectAttributeSchema

Object attribute schema.

Inherits from:

BaseAttributeSchema

Attributes:

vtype: Literal[object] = <ast.Call object at 0x0000021FE0D820B0>
properties: dict[(str, StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | FileAttributeSchema)] = <ast.Call object at 0x0000021FE0D831F0>
additional_properties: bool = <ast.Call object at 0x0000021FE0D81960>
additional_properties_key_schema: StringAttributeSchema | IntegerAttributeSchema | None = <ast.Call object at 0x0000021FE0D82AD0>
additional_properties_value_schema: StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema | None = <ast.Call object at 0x0000021FE0D823B0>
class pipeline.pipeData.ui_schema.FileAttributeSchema

File attribute schema.

Inherits from:

BaseAttributeSchema

Properties:

widget

Attributes:

vtype: Literal[gdim_file] = <ast.Call object at 0x0000021FE0D83EB0>
extension: str | list[str] | None = <ast.Call object at 0x0000021FE0D819F0>
upload: bool = <ast.Call object at 0x0000021FE0D83F10>
min_files: int = <ast.Call object at 0x0000021FE0D83070>
max_files: int | None = <ast.Call object at 0x0000021FE0DA2B30>
directory: bool = <ast.Call object at 0x0000021FE0DA2920>
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 0x0000021FE0DA0760>
columns: list[StringAttributeSchema | IntegerAttributeSchema | FloatAttributeSchema | BooleanAttributeSchema | FileAttributeSchema | ArrayAttributeSchema | ObjectAttributeSchema] = <ast.Call object at 0x0000021FE0DA2BF0>
columns_name: list[str] = <ast.Call object at 0x0000021FE0DA11E0>
min_rows: int = <ast.Call object at 0x0000021FE0DA28C0>
max_rows: int | None = <ast.Call object at 0x0000021FE0DA2E60>
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 0x0000021FE0D9C8B0>
title: str | None = <ast.Call object at 0x0000021FE0D9C940>
description: str | None = <ast.Call object at 0x0000021FE0D9C5E0>
default: Any = <ast.Call object at 0x0000021FE0D9E2C0>
required: bool = <ast.Call object at 0x0000021FE0D9DE70>
help_text: str | None = <ast.Call object at 0x0000021FE0D9D2D0>
depends_on: list[str] | str | None = <ast.Call object at 0x0000021FE0D9C2E0>
visible: bool = <ast.Call object at 0x0000021FE0D9F070>
readonly: bool = <ast.Call object at 0x0000021FE0D9EB00>
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 0x0000021FE0D9C580>
default: Any = <ast.Call object at 0x0000021FE0D9CB50>
value_type: Literal[(str, int, float, bool, list[str], list[int], list[float])] = <ast.Call object at 0x0000021FE0D9E5C0>
schema_type: Literal[(auto_select, auto_range)] = <ast.Call object at 0x0000021FE0D9CBE0>
include_min: bool = <ast.Call object at 0x0000021FE0D9C310>
include_max: bool = <ast.Call object at 0x0000021FE0D9C070>
min_items: int = <ast.Call object at 0x0000021FE0D9E740>
max_items: int | None = <ast.Call object at 0x0000021FE0D9F7C0>
visible: bool = <ast.Call object at 0x0000021FE0D9DDE0>
readonly: bool = <ast.Call object at 0x0000021FE0D9E080>
depends_on: list[str] | str | None = <ast.Call object at 0x0000021FE0DBA590>
select_enable_search: bool = <ast.Call object at 0x0000021FE0DBAC80>