Notebooks

Files, blobs and Zarr arrays

Store files and Zarr arrays in the lakehouse from a notebook, under your own catalog grants.

Not everything is a table. From a notebook you can keep files of any kind — CSVs, PDFs, Parquet, images — and Zarr arrays in the lakehouse, next to your Iceberg tables and governed by the same catalog grants.

How it works

Files and arrays live in a generic table: a catalog entry in a namespace, like an Iceberg table, that holds files instead of rows. Two helpers in databaas-utils open one for you:

HelperReturns
get_store(namespace=...)A store for reading and writing files under the generic tables in a namespace
get_zarr_group(table, namespace=...)A Zarr group for reading and writing arrays

Without namespace=, both use the namespace default. get_store() creates nothing by itself: the namespace and generic table are created on your first write to them. get_zarr_group() creates them when you open a group for writing, unless you pass create=False or read_only=True.

The catalog signs every request on your behalf and checks your grants each time, so you never hold storage keys, and you can only read or write where you have been granted access. See data permissions. Both helpers renew your token on their own, like the catalog, so a store or group stays usable for as long as your notebook runs.

Like an Iceberg table, a generic table is shared lakehouse data, not a private folder. Keep experiments in a namespace of your own.

Store and read files

Put, list, get and delete files
from pathlib import Path
from databaas_utils.user import get_store

store = get_store(namespace="sandbox")

uri = store.put("reports", "2026/summary.csv", Path("summary.csv"))   # -> "s3://…/2026/summary.csv"
store.put("reports", "2026/notes.txt", Path("notes.txt"))

for batch in store.list("reports", prefix="2026"):
    for obj in batch:
        print(obj["path"], obj["size"])

store.get("reports", "2026/notes.txt", Path("notes-downloaded.txt"))

store.delete("reports", "2026/notes.txt")

Keys are relative to the generic table, so "2026/summary.csv" is a file inside sandbox.reports.

  • put and uri create the generic table if it does not exist yet. get, open, list and delete never do, so a misspelled table name there fails instead of silently creating an empty one.
  • store.list(table, prefix=...) yields batches of objects, not single objects: each batch is a list of dictionaries with path, size and last_modified. The prefix is a folder inside the table, and the paths it returns leave it out: with prefix="2026" you get summary.csv, not 2026/summary.csv.
  • store.open(table, key) returns a readable file object without staging it to disk first.
  • store.uri(table, key) returns the s3:// URI an object has or would have.

Store and read Zarr arrays

Write a Zarr array
import numpy as np
from databaas_utils.user import get_zarr_group

root = get_zarr_group("hello_zarr", namespace="sandbox")   # created if missing
root["temperature"] = np.zeros((10, 10), dtype="f4")
Read it back
root = get_zarr_group("hello_zarr", namespace="sandbox", read_only=True)
list(root.array_keys())
root["temperature"][:2, :2]

read_only and create choose how the group opens:

read_onlycreateModeBehavior
TrueignoredrRead only; the store must already exist
FalseTrueaRead and write; created if missing (default)
FalseFalser+Read and write; the store must already exist

Every chunk you read or write is a separate signed request, so larger chunks and fewer reads are faster than many small ones.

Find them in the Data Catalog

A generic table appears in the Data Catalog in its namespace, with a format badge and its own icon. Its page has three tabs: Files to browse what is stored in it, Details, and Permissions — see table details. Grant access to it the same way as to a table.

If the generic table holds a Zarr store and you have the Use map viewer app permission, its page also has Open in Map Viewer. The button is disabled when the arrays cannot be drawn on a map; hover over it for the reason. See Map Viewer.