aito.schema.AitoBooleanArrayType
- class aito.schema.AitoBooleanArrayType
Bases:
AitoDataTypeSchemaAito Boolean Array Type
- Parameters:
aito_dtype (str) – the Aito data type
Methods
create a class object from a JSON deserialized object
from_json_string(json_string, **kwargs)create an class object from a JSON string
infer_from_samples(samples[, max_sample_size])infer AitoDataType from the given samples
the JSON schema of the class
json_schema_validate(obj)Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationErrorjson_schema_validate_with_schema(obj, schema)Validate an object with the given schema
convert the object to an object that can be serialized to a JSON formatted string
to_json_string(**kwargs)convert the object to a JSON string
the equivalent python type
Attributes
the data type
column_link_patterncolumn_name_patternproperties of the schema object that will be used for comparison operation
returns the element type for array types, or the type itself for non-array types
returns True if the data type is an array type
returns True if the data type is Boolean
returns True if the data type is Decimal
returns True if the data type is Int
returns True if the data type is String
returns True if the data type is Text
table_name_patternthe type of the schema component
uuid_pattern- property aito_dtype: str
the data type
- Return type:
str
- property comparison_properties: Iterable[str]
properties of the schema object that will be used for comparison operation
- Return type:
Iterable[str]
- property element_type: str
returns the element type for array types, or the type itself for non-array types
- Return type:
str
- classmethod from_deserialized_object(obj: str) AitoDataTypeSchema
create a class object from a JSON deserialized object
- classmethod from_json_string(json_string: str, **kwargs)
create an class object from a JSON string
- Parameters:
json_string (str) – the JSON string
kwargs – the keyword arguments for json.loads method
- classmethod infer_from_samples(samples: Iterable, max_sample_size: int = 100000) AitoDataTypeSchema
infer AitoDataType from the given samples
- Parameters:
samples (Iterable) – iterable of sample
max_sample_size (int) – at most first max_sample_size will be used for inference, defaults to 100000
- Returns:
inferred Aito column type
- Return type:
str
- property is_array: bool
returns True if the data type is an array type
- Return type:
bool
- property is_bool: bool
returns True if the data type is Boolean
- Return type:
bool
- property is_decimal: bool
returns True if the data type is Decimal
- Return type:
bool
- property is_int: bool
returns True if the data type is Int
- Return type:
bool
- property is_string: bool
returns True if the data type is String
- Return type:
bool
- property is_text: bool
returns True if the data type is Text
- Return type:
bool
- classmethod json_schema()
the JSON schema of the class
- Return type:
Dict
- classmethod json_schema_validate(obj: Any)
Validate an object with the class json_schema Returns the object if validation success, else raise
JsonValidationError- Parameters:
obj (Any) – the object to be validated
- Returns:
the object if validation succeed
- Return type:
Any
- json_schema_validate_with_schema(obj: Any, schema: Dict)
Validate an object with the given schema
- Parameters:
obj (Any) – the object to be validated
schema (Dict) – the schema to be validate against
- Returns:
the object if validation succeed
- Return type:
Any
- to_json_serializable() str
convert the object to an object that can be serialized to a JSON formatted string
- to_json_string(**kwargs)
convert the object to a JSON string
- Parameters:
kwargs – the keyword arguments for json.dumps method
- Return type:
str
- to_python_type()
the equivalent python type
- property type
the type of the schema component
- Return type:
str