Data Types¶
This module contains classes for handling the different logical types that occur in databases.
All data type constructors take a nullable: bool
parameter whose default
value is True
.
core
¶
Classes¶
Array
¶
Binary
¶
Bases: Variadic
, Singleton
A type representing a sequence of bytes.
Notes¶
Some databases treat strings and blobs of equally, and some do not.
For example, Impala doesn't make a distinction between string and binary
types but PostgreSQL has a TEXT
type and a BYTEA
type which are
distinct types that have different behavior.
Bounds
¶
DataType
¶
Bases: Concrete
, Coercible
Base class for all data types.
DataType
instances are immutable.
Attributes¶
name: str
property
¶
Return the name of the data type.
Functions¶
from_dask(dask_type, nullable=True)
classmethod
¶
Return the equivalent ibis datatype.
from_numpy(numpy_type, nullable=True)
classmethod
¶
Return the equivalent ibis datatype.
from_pandas(pandas_type, nullable=True)
classmethod
¶
Return the equivalent ibis datatype.
from_pyarrow(arrow_type, nullable=True)
classmethod
¶
Return the equivalent ibis datatype.
to_dask()
¶
Return the equivalent dask datatype.
to_numpy()
¶
Return the equivalent numpy datatype.
to_pandas()
¶
Return the equivalent pandas datatype.
to_pyarrow()
¶
Return the equivalent pyarrow datatype.
Decimal
¶
Bases: Numeric
, Parametric
Fixed-precision decimal values.
Attributes¶
largest
property
¶
Return the largest type of decimal.
precision: Optional[int] = None
class-attribute
instance-attribute
¶
The number of decimal places values of this type can hold.
scale: Optional[int] = None
class-attribute
instance-attribute
¶
The number of values after the decimal point.
Floating
¶
GeoSpatial
¶
Int16
¶
Int32
¶
Int64
¶
Int8
¶
Integer
¶
Interval
¶
Bases: Parametric
Interval values.
LineString
¶
Map
¶
MultiLineString
¶
MultiPoint
¶
MultiPolygon
¶
Point
¶
Polygon
¶
Bases: GeoSpatial
A set of one or more closed line strings.
The first line string represents the shape (external ring) and the rest represent holes in that shape (internal rings).
SignedInteger
¶
String
¶
Struct
¶
Bases: Parametric
, MapSet
Structured values.
Timestamp
¶
Bases: Temporal
, Parametric
Timestamp values.
Attributes¶
scale: Optional[Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] = None
class-attribute
instance-attribute
¶
The scale of the timestamp if known.
timezone: Optional[str] = None
class-attribute
instance-attribute
¶
The timezone of values of this type.
unit: str
property
¶
Return the unit of the timestamp.
Functions¶
from_unit(unit, timezone=None, nullable=True)
classmethod
¶
Return a timestamp type with the given unit and timezone.
UInt16
¶
UInt32
¶
UInt64
¶
UInt8
¶
UnsignedInteger
¶
Functions¶
dtype(value, nullable=True)
¶
Construct an ibis datatype from a python type.