Table class is the SDK surface for VectorShift’s managed structured store. Define columns with typed formats, fill cells by hand or via an AI generator (a Pipeline or an Agent), then query, aggregate, import, and export — all with the same fluent filter dataclasses.
Prerequisites: Installed SDK · API key set · Python 3.10+.
Mental model
- A
Tableis a named, schema’d collection of rows. Each column has a typedColumnFormat— string, number, timestamp, select, file, image, knowledge-base, and a few list variants. - A column can carry a
ColumnGenerator— either aPipelineGeneratoror anAgentGenerator— andtable.run(columns=[...])fills those cells in bulk. This is how a Table becomes a workflow surface, not just a data store. - Queries take a
CompoundFilter: groups ofFilterConditionjoined withAND/OR, withorder_by/paginatechained on. The same filter object drivesread_rows,update_rows,delete_rows,aggregate,run, andexport. - Long-running operations (
run,import_file) return a task handle (TableRunTask/TableImportTask) you poll, or use the_and_waitvariant which blocks until terminal status. - Every method has an async variant (
anew,ainsert_rows,aread_rows,arun_and_wait,ascroll, …).
Quick start
Reading rows at scale
read_rows(...) returns one page of results (about 1,000 rows by default). For tables larger than that, iterate with scroll (or ascroll for async) — it pages through every matching row using the same filters and columns arguments:
read_rows when you know the result set is small and you want a RowsPage in one call. Reach for scroll when you need every matching row, or when you don’t know how large the table is.
Pipeline and Agent generated columns
Thegeneration field on a ColumnSpec binds a column to a Pipeline or an Agent. table.run(columns=[...]) then fills those cells row-by-row using the other column values in each row as inputs.
In input_mapping, keys are the Pipeline/Agent input names and values are the table-column names the engine reads for each row. So {"vendor_name": "vendor"} means “send the value of the vendor column into the vendor_name input.”
PipelineGenerator and AgentGenerator in the reference for every field.
Column formats
Each column carries aColumnFormat — pick the variant that matches the data:
| Variant | Use for |
|---|---|
StringFormat | Free-text |
BoolFormat | True / false flags |
NumberFormat | int / float / currency / percent via NumberKind |
TimestampFormat | Dates / datetimes with a display format |
SingleSelectFormat / MultiSelectFormat | Enum-style choices with SelectOption |
FileFormat / AudioFormat / ImageFormat | Single file uploads |
KnowledgeBaseFormat | Cell points at a KnowledgeBase |
ListOfFilesFormat / ListOfStringsFormat | Lists of files / strings |
add_columns also accepts a shorthand {name: kind_string} dict — handy for quick smoke tests; the typed ColumnSpec path is recommended for real schemas.
Filtering, ordering, paginating
Every query verb takes the sameCompoundFilter. Build one with CompoundFilter.of(...) for a single-group AND/OR, or construct nested groups directly:
TableFilterOperator reference for every operator and what it matches, or the Common filter recipes example for copy-paste snippets per use case.
Long-running operations
run and import_file are async on the server. Two surfaces:
| Verb | Returns immediately | Blocks until done |
|---|---|---|
run (fill generator columns) | TableRunTask | run_and_wait |
import_file (CSV / XLSX) | TableImportTask | import_file_and_wait |
run_status(task_id) / import_file_status(task_id), or just call _and_wait with a timeout and poll_interval.
What’s next
Reference
Every public method, grouped by topic.
End-to-end walkthrough
Build a vendor scorecard from schema to export.
Common filter recipes
One snippet per operator, grouped by use case.
