compiler
¶
Phase 2: the single lazy query plan built from feature definitions.
Nothing here materializes a table, and neither does the caller. The only
collect() calls in tusk are the ones tusk.validation makes when
a check is explicitly requested.
compile_features
¶
Compute a lazy feature matrix from feature definitions.
It raises SchemaError, from
require_primary_key, if the target
table has no primary key. It raises
ValidationError, from _require_cutoff_time,
if a primitive measures against cutoff_time and none was given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
FeatureList
|
Features to compute. |
required |
database
|
Database
|
The database holding the tables. |
required |
cutoff_time
|
datetime | None
|
Only rows whose |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
feature_matrix |
LazyFrame
|
A narwhals LazyFrame with the target's primary key
plus one column per feature output, and one row per target row
visible at |