1. First feature¶
Goal: take a Teradata SQL query and turn it into a registered feature you can re-run, version, and share. Five steps.
The shape of the workflow¶
- Connect to Vantage with
tdfs4ds.connect(...). The first call also creates the catalog tables if they don't exist yet. - Pick a
DATA_DOMAINwithcreate_data_domain('MY_PROJECT')(orselect_data_domainif it already exists). Every feature, process, and dataset is tagged with this domain, which keeps unrelated projects from colliding in the same physical schema. - Write a Teradata DataFrame that selects your entity keys plus one or more feature columns from a source table.
- Call
upload_featureswith the entity ID definition and the list of feature column names. tdfs4ds registers the engineering view as a process, stores its metadata in the catalogs, runs the process for the first time, and merges the results into the feature tables. - Re-run later with
run(process_id)— no need to keep the original Python around. The view is now first-class.
import tdfs4ds, teradataml as tdml
tdfs4ds.connect(host='vantage.example.com', user='alice', password='...')
tdfs4ds.create_data_domain('CUSTOMER_360')
df = tdml.DataFrame.from_query("""
SELECT customer_id,
DATE '2024-01-01' AS feature_date,
SUM(amount) AS lifetime_amount
FROM SALES.ORDERS
GROUP BY 1, 2
""")
process_id = tdfs4ds.upload_features(
df=df,
entity_id=['customer_id'],
feature_names=['lifetime_amount'],
)
Why DATA_DOMAIN matters¶
A single Teradata database can host the feature stores of several teams or
several modelling exercises. DATA_DOMAIN is the namespace that keeps their
catalogs cleanly separated. Always set it before any registration call —
otherwise features land in the previous domain and become hard to find later.
Learn more¶
- Installation —
pip install, optional extras, and which dependencies are lazy. - Connect and configure —
connect()vssetup(),.envand JSON config files. - First feature — the same workflow with more parameter detail.
- Recipes › One-line bootstrap — a minimal
.env-driven launch. - Data domains — isolation semantics.