Data types

Scalar and column data types

Array

expr.datatypes.core.Array()

Array values.

Binary

expr.datatypes.core.Binary()

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.

Boolean

expr.datatypes.core.Boolean()

True or False values.

DataType

expr.datatypes.core.DataType()

Base class for all data types.

Instances are immutable.

Attributes

Name Description
name Return the name of the data type.

Methods

Name Description
from_dask Return the equivalent ibis datatype.
from_numpy Return the equivalent ibis datatype.
from_pandas Return the equivalent ibis datatype.
from_pyarrow Return the equivalent ibis datatype.
is_array Return True if an instance of an Array type.
is_binary Return True if an instance of a Binary type.
is_boolean Return True if an instance of a Boolean type.
is_date Return True if an instance of a Date type.
is_decimal Return True if an instance of a Decimal type.
is_enum Return True if an instance of an Enum type.
is_float16 Return True if an instance of a Float16 type.
is_float32 Return True if an instance of a Float32 type.
is_float64 Return True if an instance of a Float64 type.
is_floating Return True if an instance of any Floating type.
is_geospatial Return True if an instance of a Geospatial type.
is_inet Return True if an instance of an Inet type.
is_int16 Return True if an instance of an Int16 type.
is_int32 Return True if an instance of an Int32 type.
is_int64 Return True if an instance of an Int64 type.
is_int8 Return True if an instance of an Int8 type.
is_integer Return True if an instance of any Integer type.
is_interval Return True if an instance of an Interval type.
is_json Return True if an instance of a JSON type.
is_linestring Return True if an instance of a LineString type.
is_macaddr Return True if an instance of a MACADDR type.
is_map Return True if an instance of a Map type.
is_multilinestring Return True if an instance of a MultiLineString type.
is_multipoint Return True if an instance of a MultiPoint type.
is_multipolygon Return True if an instance of a MultiPolygon type.
is_nested Return true if an instance of any nested (Array/Map/Struct) type.
is_null Return true if an instance of a Null type.
is_numeric Return true if an instance of a Numeric type.
is_point Return true if an instance of a Point type.
is_polygon Return true if an instance of a Polygon type.
is_primitive Return true if an instance of a Primitive type.
is_signed_integer Return true if an instance of a SignedInteger type.
is_string Return true if an instance of a String type.
is_struct Return true if an instance of a Struct type.
is_temporal Return true if an instance of a Temporal type.
is_time Return true if an instance of a Time type.
is_timestamp Return true if an instance of a Timestamp type.
is_uint16 Return true if an instance of a UInt16 type.
is_uint32 Return true if an instance of a UInt32 type.
is_uint64 Return true if an instance of a UInt64 type.
is_uint8 Return true if an instance of a UInt8 type.
is_unknown Return true if an instance of an Unknown type.
is_unsigned_integer Return true if an instance of an UnsignedInteger type.
is_uuid Return true if an instance of a UUID type.
is_variadic Return true if an instance of a Variadic type.
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.

from_dask

from_dask(cls, dask_type, nullable=True)

Return the equivalent ibis datatype.

from_numpy

from_numpy(cls, numpy_type, nullable=True)

Return the equivalent ibis datatype.

from_pandas

from_pandas(cls, pandas_type, nullable=True)

Return the equivalent ibis datatype.

from_pyarrow

from_pyarrow(cls, arrow_type, nullable=True)

Return the equivalent ibis datatype.

is_array

is_array(self)

Return True if an instance of an Array type.

is_binary

is_binary(self)

Return True if an instance of a Binary type.

is_boolean

is_boolean(self)

Return True if an instance of a Boolean type.

is_date

is_date(self)

Return True if an instance of a Date type.

is_decimal

is_decimal(self)

Return True if an instance of a Decimal type.

is_enum

is_enum(self)

Return True if an instance of an Enum type.

is_float16

is_float16(self)

Return True if an instance of a Float16 type.

is_float32

is_float32(self)

Return True if an instance of a Float32 type.

is_float64

is_float64(self)

Return True if an instance of a Float64 type.

is_floating

is_floating(self)

Return True if an instance of any Floating type.

is_geospatial

is_geospatial(self)

Return True if an instance of a Geospatial type.

is_inet

is_inet(self)

Return True if an instance of an Inet type.

is_int16

is_int16(self)

Return True if an instance of an Int16 type.

is_int32

is_int32(self)

Return True if an instance of an Int32 type.

is_int64

is_int64(self)

Return True if an instance of an Int64 type.

is_int8

is_int8(self)

Return True if an instance of an Int8 type.

is_integer

is_integer(self)

Return True if an instance of any Integer type.

is_interval

is_interval(self)

Return True if an instance of an Interval type.

is_json

is_json(self)

Return True if an instance of a JSON type.

is_linestring

is_linestring(self)

Return True if an instance of a LineString type.

is_macaddr

is_macaddr(self)

Return True if an instance of a MACADDR type.

is_map

is_map(self)

Return True if an instance of a Map type.

is_multilinestring

is_multilinestring(self)

Return True if an instance of a MultiLineString type.

is_multipoint

is_multipoint(self)

Return True if an instance of a MultiPoint type.

is_multipolygon

is_multipolygon(self)

Return True if an instance of a MultiPolygon type.

is_nested

is_nested(self)

Return true if an instance of any nested (Array/Map/Struct) type.

is_null

is_null(self)

Return true if an instance of a Null type.

is_numeric

is_numeric(self)

Return true if an instance of a Numeric type.

is_point

is_point(self)

Return true if an instance of a Point type.

is_polygon

is_polygon(self)

Return true if an instance of a Polygon type.

is_primitive

is_primitive(self)

Return true if an instance of a Primitive type.

is_signed_integer

is_signed_integer(self)

Return true if an instance of a SignedInteger type.

is_string

is_string(self)

Return true if an instance of a String type.

is_struct

is_struct(self)

Return true if an instance of a Struct type.

is_temporal

is_temporal(self)

Return true if an instance of a Temporal type.

is_time

is_time(self)

Return true if an instance of a Time type.

is_timestamp

is_timestamp(self)

Return true if an instance of a Timestamp type.

is_uint16

is_uint16(self)

Return true if an instance of a UInt16 type.

is_uint32

is_uint32(self)

Return true if an instance of a UInt32 type.

is_uint64

is_uint64(self)

Return true if an instance of a UInt64 type.

is_uint8

is_uint8(self)

Return true if an instance of a UInt8 type.

is_unknown

is_unknown(self)

Return true if an instance of an Unknown type.

is_unsigned_integer

is_unsigned_integer(self)

Return true if an instance of an UnsignedInteger type.

is_uuid

is_uuid(self)

Return true if an instance of a UUID type.

is_variadic

is_variadic(self)

Return true if an instance of a Variadic type.

to_dask

to_dask(self)

Return the equivalent dask datatype.

to_numpy

to_numpy(self)

Return the equivalent numpy datatype.

to_pandas

to_pandas(self)

Return the equivalent pandas datatype.

to_pyarrow

to_pyarrow(self)

Return the equivalent pyarrow datatype.

Date

expr.datatypes.core.Date()

Date values.

Decimal

expr.datatypes.core.Decimal(self, precision=None, scale=None, **kwargs)

Fixed-precision decimal values.

Attributes

Name Description
largest Return the largest type of decimal.
precision The number of decimal places values of this type can hold.
scale The number of values after the decimal point.

Float16

expr.datatypes.core.Float16()

16-bit floating point numbers.

Float32

expr.datatypes.core.Float32()

32-bit floating point numbers.

Float64

expr.datatypes.core.Float64()

64-bit floating point numbers.

INET

expr.datatypes.core.INET()

IP addresses.

Int16

expr.datatypes.core.Int16()

Signed 16-bit integers.

Int32

expr.datatypes.core.Int32()

Signed 32-bit integers.

Int64

expr.datatypes.core.Int64()

Signed 64-bit integers.

Int8

expr.datatypes.core.Int8()

Signed 8-bit integers.

Interval

expr.datatypes.core.Interval()

Interval values.

Attributes

Name Description
resolution The interval unit’s name.
unit The time unit of the interval.

JSON

expr.datatypes.core.JSON()

JSON values.

LineString

expr.datatypes.core.LineString()

A sequence of 2 or more points.

MACADDR

expr.datatypes.core.MACADDR()

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

Map

expr.datatypes.core.Map()

Associative array values.

MultiLineString

expr.datatypes.core.MultiLineString()

A set of one or more line strings.

MultiPoint

expr.datatypes.core.MultiPoint()

A set of one or more points.

MultiPolygon

expr.datatypes.core.MultiPolygon()

A set of one or more polygons.

Null

expr.datatypes.core.Null()

Null values.

Point

expr.datatypes.core.Point()

A point described by two coordinates.

Polygon

expr.datatypes.core.Polygon()

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

String

expr.datatypes.core.String()

Notes

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

Struct

expr.datatypes.core.Struct()

Structured values.

Methods

Name Description
from_tuples Construct a Struct type from pairs.
names Return the names of the struct’s fields.
types Return the types of the struct’s fields.

from_tuples

from_tuples(cls, pairs, nullable=True)

Construct a Struct type from pairs.

Parameters

Name Type Description Default
pairs Iterable[tuple[str, str | DataType]] An iterable of pairs of field name and type required
nullable bool Whether the type is nullable True

Returns

Type Description
Struct Struct data type instance

names

names(self)

Return the names of the struct’s fields.

types

types(self)

Return the types of the struct’s fields.

Time

expr.datatypes.core.Time()

Time values.

Timestamp

expr.datatypes.core.Timestamp()

Timestamp values.

Attributes

Name Description
scale The scale of the timestamp if known.
timezone The timezone of values of this type.
unit Return the unit of the timestamp.

Methods

Name Description
from_unit Return a timestamp type with the given unit and timezone.

from_unit

from_unit(cls, unit, timezone=None, nullable=True)

Return a timestamp type with the given unit and timezone.

UInt16

expr.datatypes.core.UInt16()

Unsigned 16-bit integers.

UInt32

expr.datatypes.core.UInt32()

Unsigned 32-bit integers.

UInt64

expr.datatypes.core.UInt64()

Unsigned 64-bit integers.

UInt8

expr.datatypes.core.UInt8()

Unsigned 8-bit integers.

UUID

expr.datatypes.core.UUID()

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

Back to top