Skip to main content

Row

This class represents a structured data definition used for validation and schema generation, capturing field types, input sources, and validation constraints. It provides properties to format type information and input sources into human-readable strings for documentation or reporting. Additionally, it supports the inclusion of validation examples and core schema references to define data integrity rules.

Attributes

AttributeTypeDescription
field_type`type[Any]str`
input_type`type[Any]str`
python_inputbool = FalseFlag indicating if the row supports input data originating from Python objects.
json_inputbool = FalseFlag indicating if the row supports input data originating from JSON strings.
strictbool = FalseDetermines whether validation should strictly enforce types without attempting coercion.
condition`strNone` = None
valid_examples`list[Any]None` = None
invalid_examples`list[Any]None` = None
core_schemas`list[type[CoreSchema]]None` = None

Methods


field_type_str()

@classmethod
def field_type_str() - > string

Returns the string representation of the field type, using the type's name if available or the raw value otherwise.

Returns

TypeDescription
stringThe name of the field type or its string representation for display purposes.

input_type_str()

@classmethod
def input_type_str() - > string

Returns the string representation of the input type, using the type's name if available or the raw value otherwise.

Returns

TypeDescription
stringThe name of the input type or its string representation for display purposes.

input_source_str()

@classmethod
def input_source_str() - > string

Determines the human-readable source of the input data based on whether Python or JSON inputs are enabled.

Returns

TypeDescription
stringA string indicating the source, such as 'Python', 'JSON', 'Python & JSON', or an empty string if neither is set.