Source code for superduperdb.backends.ibis.field_types

import dataclasses as dc
import typing as t

from ibis.expr.datatypes import DataType, dtype as _dtype

from superduperdb.base.serializable import Serializable


[docs] @dc.dataclass class FieldType(Serializable): identifier: t.Union[str, DataType] def __post_init__(self): if isinstance(self.identifier, DataType): self.identifier = self.identifier.name
[docs] def dtype(x): ''' Ibis dtype to represent basic data types in ibis e.g int, str, etc ''' return FieldType(_dtype(x))