Skip to content

Data Types

This module contains classes for handling the different storage types that occur in databases.

All data type constructors take a nullable: bool parameter whose default value is True.

datatypes special



Any (DataType)

Values of any type.

Array (Variadic)

Array values.

Binary (Singleton, Variadic)

A type representing a sequence of bytes.


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.

Boolean (Primitive)

True or False values.

Bounds (tuple)

The lower and upper bound of a fixed-size value.

DataType (Annotable, Comparable)

Base class for all data types.

DataType instances are immutable.

name: str property readonly

Return the name of the data type.

cast(self, target, **kwargs)

Cast this data type to target.

castable(self, target, **kwargs)

Return whether this data type is castable to target.


Convert ibis dtype to the pandas / numpy alternative

Date (Primitive)

Date values.

Decimal (DataType)

Fixed-precision decimal values.

largest property readonly

Return the largest type of decimal.


The number of decimal places values of this type can hold.


The number of values after the decimal point.

Enum (DataType)

Enumeration values.

Float16 (Floating)

16-bit floating point numbers.

Float32 (Floating)

32-bit floating point numbers.

Float64 (Floating)

64-bit floating point numbers.

Floating (Primitive)

Floating point values.

largest property readonly

Return the largest type of floating point values.

GeoSpatial (DataType)

Geospatial values.


The specific geospatial type


The spatial reference identifier.

Geography (GeoSpatial)

Geography values.

Geometry (GeoSpatial)

Geometry values.

INET (String)

IP addresses.

Int16 (SignedInteger)

Signed 16-bit integers.

Int32 (SignedInteger)

Signed 32-bit integers.

Int64 (SignedInteger)

Signed 64-bit integers.

Int8 (SignedInteger)

Signed 8-bit integers.

Integer (Primitive)

Integer values.

Interval (DataType)

Interval values.

resolution property readonly

The interval unit's name.


The time unit of the interval.


The underlying type of the stored values.

JSON (String)

JSON values.

JSONB (Binary)

JSON data stored in a binary representation.

This representation eliminates whitespace, duplicate keys, and does not preserve key ordering.

LineString (GeoSpatial)

A sequence of 2 or more points.

MACADDR (String)

Media Access Control (MAC) address of a network interface.

Map (Variadic)

Associative array values.

MultiLineString (GeoSpatial)

A set of one or more line strings.

MultiPoint (GeoSpatial)

A set of one or more points.

MultiPolygon (GeoSpatial)

A set of one or more polygons.

Null (Singleton, DataType)

Null values.

Point (GeoSpatial)

A point described by two coordinates.

Polygon (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).

Primitive (Singleton, DataType)

Values with known size.

Set (Variadic)

Set values.

SignedInteger (Integer)

Signed integer values.

largest property readonly

Return the largest type of signed integer.

String (Singleton, Variadic)

A type representing a string.


Because of differences in the way different backends handle strings, we cannot assume that strings are UTF-8 encoded.

Struct (DataType)

Structured values.

pairs: Mapping[str, DataType] property readonly

Return a mapping from names to data type instances.


Mapping[str, DataType] Mapping of field name to data type

from_dict(pairs, nullable=True) classmethod

Construct a Struct type from a dict.


pairs A dict of field: type


Struct Struct data type instance

from_tuples(pairs, nullable=True) classmethod

Construct a Struct type from pairs.


pairs An iterable of pairs of field name and type


Struct Struct data type instance

Time (Primitive)

Time values.

Timestamp (DataType)

Timestamp values.


The timezone of values of this type.

UInt16 (UnsignedInteger)

Unsigned 16-bit integers.

UInt32 (UnsignedInteger)

Unsigned 32-bit integers.

UInt64 (UnsignedInteger)

Unsigned 64-bit integers.

UInt8 (UnsignedInteger)

Unsigned 8-bit integers.

UUID (DataType)

A 128-bit number used to identify information in computer systems.

UnsignedInteger (Integer)

Unsigned integer values.

largest property readonly

Return the largest type of unsigned integer.

Variadic (DataType)

Values with unknown size.

cast(source, target, **kwargs)

Attempts to implicitly cast from source dtype to target dtype


Parse a type from a str text.

The default maxsize parameter for caching is chosen to cache the most commonly used types--there are about 30--along with some capacity for less common but repeatedly-used complex types.


text The type string to parse


Parse an array type from a string

import ibis import ibis.expr.datatypes as dt dt.parse("array") Array(value_type=Int64(nullable=True), nullable=True)

You can avoid parsing altogether by constructing objects directly

import ibis import ibis.expr.datatypes as dt ty = dt.parse("array") ty == dt.Array(dt.int64) True

parse_type(*args, **kwargs)

DEPRECATED: parse_type is deprecated as of v4.0; use ibis.expr.datatypes.core.parse

Last update: March 22, 2022