Lifecycle
new
columns to seed the schema in one call; omit it to start empty and add columns later with add_column / add_columns.
Parameters
Display name of the table.
Initial column schema. See
ColumnSpec.The new
Table instance.fetch
id or name. Exactly one is required. username and org_name scope name-fetches to a specific owner.
list
update
self and returns it.
duplicate
new_name to set the duplicate’s name; otherwise the server auto-generates one.
delete
Column schema
add_column
format is one of the ColumnFormat variants. generation binds the column to a PipelineGenerator or AgentGenerator — see ColumnGenerator.
add_columns
ColumnSpec (recommended) or a shorthand {name: kind_string} dict for quick smoke tests.
rename_column
delete_column
update_column
display_name. Existing cell values must be coercible to the new format.
list_columns
table.columns exposes the same list as an attribute.
Row CRUD
insert_row
None — use insert_rows when you need the inserted count, or follow up with read_rows(filters=...) to inspect.
insert_rows
InsertRowsResult with success and rows_inserted.
read_rows
filters. Pass columns to project only specific column names. Returns a RowsPage with rows and a total count. Capped at one page (~1,000 rows by default) — use scroll to iterate past that.
update_rows
filters. filters is required to prevent accidental table-wide updates. Returns the number of rows touched — but note this may be 0 even on success, because the engine does not currently report a count. If you really do want to clear the table, call clear instead.
delete_rows
filters. filters is required. Returns the number of rows deleted — but note this may be 0 even on success, because the engine does not currently report a count.
clear
delete_rows when you genuinely want to empty the table.
scroll
page_size.
Running generators
A column with aPipelineGenerator or AgentGenerator attached gets its cells filled by table.run(columns=[...]). Without generator columns, run is a no-op.
run
TableRunTask — poll via run_status(task_id) or block via run_and_wait. filters scopes which rows are updated.
run_status
run_and_wait
run. Raises TableRunTimeout on timeout, TableRunFailed if the task ends in FAILED.
Aggregation
aggregate
filters. Each (column, AggregationType) pair returns one value. See AggregationType for the 21 supported functions (SUM, AVERAGE, MEDIAN, MIN, MAX, RANGE, STANDARD_DEVIATION, UNIQUE, EARLIEST_DATE, …).
Import / export
import_file
column_mapping maps file-column names to table-column names. custom_headers lets you supply headers when the file has none. format defaults to AUTO (sniff by extension).
import_file_status
import_file_and_wait
TableImportTimeout / TableImportFailed.
export
content. For large exports the server streams to object storage and content is empty — use s3_key (and s3_url if provided) to fetch the file.
Queries
nl_query
NlQueryResult with an answer and the intermediate dataframes (protojson-encoded JSON strings).
Serialization
to_dict
Types
ColumnSpec
Table.add_column[s] and Table.new(columns=...). Pairs a column name with a typed ColumnFormat and an optional ColumnGenerator.
Column
Returned by list_columns() / table.columns.
ColumnFormat
A column’s format is one of the variants below. Each variant carries a kind literal identifying it.
StringFormat
BoolFormat
NumberFormat
TimestampFormat
SingleSelectFormat / MultiSelectFormat
SelectOption
FileFormat / AudioFormat / ImageFormat
KnowledgeBaseFormat
ListOfFilesFormat / ListOfStringsFormat
ColumnGenerator
Two variants today: PipelineGenerator and AgentGenerator. Attach one to ColumnSpec.generation to make a column AI-filled.
PipelineGenerator
Pipeline once per row.
input_mapping— keys are pipeline input names, values are table-column names. For each row, the engine reads the value of the named column and passes it into the matching pipeline input. Example:{"vendor_name": "vendor", "raw_notes": "notes"}sends the row’svendorvalue to thevendor_nameinput and thenotesvalue toraw_notes.output_name— which pipeline output to write into the cell.auto_execute=True— the engine fires the pipeline as new rows arrive instead of waiting for an explicittable.run(...).
AgentGenerator
Agent.
instructions— the per-cell prompt template the agent runs against each row.input_mapping— keys are agent input names, values are table-column names. For each row, the engine reads the value of the named column and passes it into the matching agent input.knowledge_base(optional) — gives the agent retrieval context for the cell.auto_execute=True— the engine fires the agent as new rows arrive instead of waiting for an explicittable.run(...).
CompoundFilter
group_logical_operator; within each FilterGroup, conditions join via that group’s logical_operator.
Builders
All builders return a new
CompoundFilter (the dataclass is frozen).
FilterGroup
FilterCondition
field should satisfy operator against value”. value is the Python value for that column — bool, int, float, str, datetime, list, or None — and the SDK encodes it for the wire.
TableFilterOperator
The 13 operators you can pass to a FilterCondition, grouped by what they do.
Equality and set membership
RelationalOperator
OrderByDirection
AggregationType
21 functions covering counts, percentages, numeric reductions, boolean truth-counts, and timestamp ranges:
Numeric reductions require numeric columns; boolean reductions require bool columns; timestamp reductions require timestamp columns.
ColumnKind
The resolved kind on a returned Column. One of: string, bool, int, float, currency, percent, timestamp, single_select, multi_select, file, audio, image, knowledge_base, list_of_files, list_of_strings.
NumberKind
ExportFormat
ImportFormat
RunStatus
ImportStatus
Same four values as RunStatus.
Row
TypedDict:
RowsPage
TypedDict:
InsertRowsResult
TypedDict:
AggregationResult
TypedDict:
NlQueryResult
TypedDict:
TableExportResult
TypedDict:
TableRunTask
Frozen dataclass — a poll handle for Table.run.
TableImportTask
Frozen dataclass — a poll handle for Table.import_file.
Errors
All Table errors inherit fromTableError (which inherits from VectorshiftError).
Catch
VectorshiftApiError from vectorshift.request for transport-level failures (HTTP 4xx/5xx).