Skip to main content

Data Types

The Python client uses PyArrow types for schema definitions:

PyArrow TypeFluss TypePython Type
pa.bool_()Booleanbool
pa.int8() / int16() / int32() / int64()TinyInt / SmallInt / Int / BigIntint
pa.float32() / float64()Float / Doublefloat
pa.string()Stringstr
pa.binary()Bytesbytes
pa.date32()Datedatetime.date
pa.time32("ms")Timedatetime.time
pa.timestamp("us")Timestamp (NTZ)datetime.datetime
pa.timestamp("us", tz="UTC")TimestampLTZdatetime.datetime
pa.decimal128(precision, scale)Decimaldecimal.Decimal

All Python native types (date, time, datetime, Decimal) work when appending rows via dicts.

Writing Data

Rows can be dicts, lists, or tuples:

from datetime import date, time, datetime
from decimal import Decimal

row = {
"user_id": 1,
"name": "Alice",
"active": True,
"score": 95.5,
"balance": Decimal("1234.56"),
"birth_date": date(1990, 3, 15),
"login_time": time(9, 30, 0),
"created_at": datetime(2024, 1, 1, 0, 0, 0),
"nickname": None, # null value
}
handle = writer.append(row)

Lists and tuples must have values in column order:

row = [1, "Alice", True, 95.5, Decimal("1234.56"), date(1990, 3, 15), time(9, 30, 0), datetime(2024, 1, 1), None]
handle = writer.append(row)

Reading Data

records = scanner.poll(timeout_ms=1000)
for record in records:
row = record.row # dict[str, Any]
print(row["user_id"]) # int
print(row["name"]) # str
print(row["balance"]) # decimal.Decimal
print(row["birth_date"]) # datetime.date
print(row["created_at"]) # datetime.datetime

if row["nickname"] is None:
print("nickname is null")