ColumnInfo 类

Dataverse 表定义的列元数据。

构造函数

ColumnInfo(schema_name: str = '', logical_name: str = '', type: str = '', is_primary: bool = False, is_required: bool = False, max_length: int | None = None, display_name: str | None = None, description: str | None = None)

参数

名称 说明
schema_name
必需
str

列架构名称(例如 "new_Price")。

logical_name
必需
str

列逻辑名称(小写)。

type
必需
str

列类型字符串(例如 "String""Integer")。

is_primary

这是否为主名称列。

默认值: False
is_required

是否需要该列。

默认值: False
max_length
int

字符串列的最大长度。

默认值: None
display_name
str

人工可读的显示名称。

默认值: None
description
str

列说明。

默认值: None

方法

from_api_response

从原始 Dataverse AttributeMetadata API 响应创建。

from_api_response

从原始 Dataverse AttributeMetadata API 响应创建。

from_api_response(response_data: Dict[str, Any]) -> ColumnInfo

参数

名称 说明
response_data
必需

原始属性元数据听写(PascalCase 键)。

返回

类型 说明

属性

description

description: str | None = None

display_name

display_name: str | None = None

is_primary

is_primary: bool = False

is_required

is_required: bool = False

logical_name

logical_name: str = ''

max_length

max_length: int | None = None

schema_name

schema_name: str = ''

type

type: str = ''