Skip to content

Columns

Identifiers and Case Sensitivity

Bundlebase is always case-sensitive. Column names preserve their exact case — Revenue, revenue, and REVENUE are three different columns. This is intentional: bundlebase works with disparate data sources (CSVs, APIs, Parquet files, databases) that each have their own casing conventions, so no normalization is assumed.

Quoted identifiers: Use double quotes for column names containing spaces, dots, slashes, or other special characters:

RENAME COLUMN "ResultMeasureValue" TO secchi_depth
CAST COLUMN "Measure/Unit" TO Utf8
DROP COLUMN "column with spaces"

Bare identifiers (without quotes) work for names containing only letters, digits, and underscores. Quotes are always optional for such names.

Tip

If you're working with data that has messy column names (spaces, mixed case, special characters), use NORMALIZE COLUMN NAMES to normalize them all at once.

Drop Column

Remove a column from the bundle.

await bundle.drop_column("middle_name")
bundle.drop_column("middle_name")
DROP COLUMN middle_name

Rename Column

Rename an existing column.

await bundle.rename_column("first_name", new_name="name")
bundle.rename_column("first_name", new_name="name")
RENAME COLUMN first_name TO name

Normalize Column Names

Convert all column names to lowercase, underscore-separated identifiers that work without quoting in SQL. Spaces, dashes, dots, and other special characters are replaced with underscores, consecutive underscores are collapsed, and leading/trailing underscores are stripped.

For example, "Customer Id" becomes customer_id and "Phone 1" becomes phone_1.

await bundle.normalize_column_names()
bundle.normalize_column_names()

Add Column

Create a computed column from a SQL expression.

await bundle.add_column("full_name", "first_name || ' ' || last_name")
bundle.add_column("full_name", "first_name || ' ' || last_name")
ADD COLUMN full_name AS first_name || ' ' || last_name

Computed columns can be indexed just like regular columns.

Cast Column

Change a column's data type.

await bundle.cast_column("price", "integer")
bundle.cast_column("price", "integer")
CAST COLUMN price TO integer