Commit 7ea8bf5
feat(bigframes): Support Expression objects in create_model options
This change allows the `options` parameter of `bigframes.bigquery._operations.ml.create_model` to accept BigFrames `Expression` objects. These expressions are compiled to SQL scalar expressions and included in the generated `CREATE MODEL` DDL statement.
- Added `bigframes.core.expression.Expression` type support in the `options` dict.
- Updated `create_model_ddl` to handle compiling expressions using `expression_compiler`.
- Added `test_create_model_expression_option` snapshot test to verify the generated "golden SQL", using an expression that calls a function on a literal value (e.g. 0.1 * 10).
Co-authored-by: tswast <247555+tswast@users.noreply.github.com>1 parent b5e8a06 commit 7ea8bf5
File tree
2 files changed
+10
-2
lines changed- packages/bigframes/tests/unit/core/sql
- snapshots/test_ml/test_create_model_expression_option
2 files changed
+10
-2
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
106 | | - | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
| |||
0 commit comments