Upload, optimise, document — in one go¶
upload_features accepts three AI toggles. When an instruct model is
configured, you can register a feature engineering view, let the query
optimizer try to rewrite it, replace the view if the score improves, and
generate the documentation — all from a single call.
tdfs4ds.upload_features(
df,
entity_id = ['CUSTOMER_ID'],
feature_names = ['nb_transactions', 'total_amount', 'avg_amount'],
metadata = {'project': 'customer_analytics'},
# AI add-ons (silently skipped when no instruct model is configured)
optimize_query = True, # run the 9-step optimiser
update_view = True, # REPLACE VIEW with the winner when score improves
document = True, # populate process docs + EXPLAIN score
max_candidates = 5, # override tdfs4ds.QUERY_OPTIMIZER_MAX_CANDIDATES
# Optional dataset build + documentation
dataset_view_name = 'ds_customer_spend',
)
What runs (in order):
- Register entity, features, and process.
- Persist
register_process_viewSQL (process catalog, data distribution, optional FilterManager). skill_optimize_query— generate candidates, score, optionallyREPLACE VIEW.document_process_incremental— business logic + per-feature + EXPLAIN docs.run(process_id)— ingest values via the (now-optimized) view.- If
dataset_view_nameset: build the dataset view, thendocument_dataset_incremental.
Reports for the optimiser land under
{QUERY_OPTIMIZER_REPORT_DIR}/{DATA_DOMAIN}/. Failures in steps 3 / 4 / 6
are non-fatal — the ingestion result is never affected.