Repository navigation
[FS2524] Add Feature Spec as a Bundle Resource - #7364
Daniel114510 wants to merge 16 commits into
Conversation
Dropped when rebasing onto the bot's Update Go SDK to v0.194.0 PR. Co-authored-by: Isaac <no-reply@databricks.com>
A feature spec has create, get and delete and no update, and every field is immutable, so any change recreates it. It is a UC function, so its grants go through the existing grants sub-resource with securable type "function"; on a recreate the grants node plans an update and re-applies them. The map-like pair lists (rename_outputs, default_values, input_bindings) are compared by key, and exclude_columns and the extra pip requirements are sorted on both sides, so reordering them is not a recreate. features and the lookup keys stay positional: their order sets the output columns and must match the table's primary key. Co-authored-by: Isaac <no-reply@databricks.com>
… FeatureSpec Replaced by the generator after rebasing onto the SDK bump. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Also give the fake's feature spec map its own block and shorten the recreate prompt. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 14 changed tests (limit=20, 0 not selected) 21 tests: regression=14 unreleased=0 coverage=7 failing=0
TestAccept/bundle/deployment/bind/feature_spec/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/deployment/bind/feature_spec/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/python/feature_specs-support/DMS=/PYDAB_VERSION=current: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/python/feature_specs-support/DMS=true/PYDAB_VERSION=current: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/refschema/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/refschema/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/resource_deps/implicit_deps_feature_spec/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/resource_deps/implicit_deps_feature_spec/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/resources/feature_specs/basic/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/resources/feature_specs/order/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/resources/feature_specs/remote-delete/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/resources/feature_specs/uppercase-name/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) 2 more failure details omitted, see the full report in the run. |
❌ Integration test reportCommit: 700f5e0
25 interesting tests: 25 FAIL
|
Every feature spec case that deploys now sets Cloud = true, and the
invariant matrix no longer skips feature_spec.yml.tmpl on cloud.
Creating a feature spec resolves its lookup tables and UDFs in Unity
Catalog, so each case creates them in a per-run main.fspec_<unique>
schema with create_feature_spec_fixtures.py and drops the schema on
exit. Bundle names carry $UNIQUE_NAME so parallel runs do not share
state. The grants case grants to account users, which exists in every
workspace. The bind case binds a spec created outside the bundle and
plans no change.
The fake's delete now returns {} like the real endpoint.
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Regenerated from the FeatureSpec API in .codegen/cli.json (Go SDK v0.194.0): the bundle JSON schema, required-field validation, the direct engine API types, the refschema field list and the PyDABs models. configs/feature_specs.generated.yml regenerates unchanged. Fills the three schema placeholders the resource adds, following the features and registered_models entries. The grants example uses EXECUTE, since a feature spec is a UC function. Adds the python/feature_specs-support golden. Co-authored-by: Isaac <no-reply@databricks.com>
main now builds with Go 1.27, whose modernize embedlit check flags the embedded type name in a struct literal. Co-authored-by: Isaac <no-reply@databricks.com>
&>> needs bash 4; the macOS runners use bash 3.2, which rejects the scripts before they run. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
UC lowercases a feature spec's name, and create and get now return it that way. Listing name in provided_id_fields skips that read-back difference, as it does for a schema's name, so a mixed-case name no longer recreates the feature spec on every plan. The fake lowercases the name like the real endpoint. Co-authored-by: Isaac <no-reply@databricks.com>
Changes
Add
feature_specsas a bundle resource type, with agrantsfield for Unity Catalog privileges on the feature spec.IMMUTABLE. Any change therefore recreates the spec, and the adapter has noDoUpdate.grantsreuses the grants sub-resource with securable typefunction. When the spec is recreated, the bundle re-applies its declared grants to the new spec.rename_outputs,default_valuesandinput_bindingsof feature spec are compared by key. The string list fieldsexclude_columnsandextra_pip_requirements.requirementsare sorted in both the config and the read. This ensures reordering any of these order-free lists plans no change instead of a recreate.bundle deployandbundle destroyask for approval before recreating or deleting a feature spec.Why
Feature specs can only be created through the Python client or the API today. Supporting them in bundles is part of bringing the Feature Engineering API to Declarative Automation Bundles.
Tests
bundle/resources/feature_specs/basic: create, no-op plan, recreate, destroybundle/resources/feature_specs/order: which list reorders recreatebundle/resources/feature_specs/remote-delete: spec deleted outside the bundlebundle/resources/grants/feature_specs: grants re-applied after recreatebundle/deployment/bind/feature_spec: bind and unbind an existing specbundle/resource_deps/implicit_deps_feature_spec: deploys after its catalog and schemabundle/invariant/configs/feature_spec.yml.tmpl: no drift, repeatable delete and destroybundle/python/feature_specs-support: specs defined and changed in Pythonexperimental/open: listsfeature_specsbundle/direct/dresources/feature_spec_test.go: list sorting and matching