Skip to main content

types

Type annotations for UDF parameters. Use these to get proper type hints and enable Fused-specific behaviors.

import fused
from fused.types import Bounds, TileGDF

@fused.udf
def udf(bounds: Bounds = None):
...

Type Variables

Bounds

Bounds = TypeVar("Bounds", bound=list)

A bounding box as a list of [min_x, min_y, max_x, max_y]. When used as a UDF parameter type hint, Fused automatically structures the bounds object based on how the UDF is called.

@fused.udf
def udf(bounds: fused.types.Bounds = None):
# bounds is structured by Fused based on x, y, z or bbox input
return gdf[gdf.geometry.intersects(bounds.geometry[0])]

Bbox [Legacy]

Bbox = TypeVar("Bbox", bound=shapely.geometry.polygon.Polygon)

A bounding box as a Shapely Polygon geometry.

Tile [Legacy]

Tile = TypeVar("Tile", bound=gpd.GeoDataFrame)

A GeoDataFrame representing a tile. Alias for TileGDF.

TileGDF [Legacy]

TileGDF = TypeVar("TileGDF", bound=gpd.GeoDataFrame)

A GeoDataFrame representing a tile with geometry and metadata columns.

TileXYZ [Legacy]

TileXYZ = TypeVar("TileXYZ", bound=mercantile.Tile)

A mercantile Tile object with x, y, z attributes.

ViewportGDF [Legacy]

ViewportGDF = TypeVar("ViewportGDF", bound=gpd.GeoDataFrame)

A GeoDataFrame representing the current viewport bounds.

Exception Types

UdfTimeoutError

Raised when a UDF execution exceeds the time limit.

UdfRuntimeError

Raised when a UDF encounters a runtime error during execution.

UdfSerializationError

Raised when a UDF result cannot be serialized for return.