Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f2843dd06e095a39dda2d454a97ceaf6767a2bf3
c4784cea599325a13472b1455e7434d639362d8b
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ cmd/workspace/current-user/current-user.go linguist-generated=true
cmd/workspace/dashboard-email-subscriptions/dashboard-email-subscriptions.go linguist-generated=true
cmd/workspace/dashboard-widgets/dashboard-widgets.go linguist-generated=true
cmd/workspace/dashboards/dashboards.go linguist-generated=true
cmd/workspace/data-quality/data-quality.go linguist-generated=true
cmd/workspace/data-sources/data-sources.go linguist-generated=true
cmd/workspace/database/database.go linguist-generated=true
cmd/workspace/default-namespace/default-namespace.go linguist-generated=true
Expand Down
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add the `--configure-serverless` flag to `databricks auth login` to configure Databricks Connect to use serverless.

### Dependency updates
* Upgrade Go SDK to 0.82.0 ([#3769](https://github.com/databricks/cli/pull/3769))

### Bundles
* Updated the internal lakeflow-pipelines template to use an "src" layout ([#3671](https://github.com/databricks/cli/pull/3671)).
Expand Down
3 changes: 2 additions & 1 deletion acceptance/bundle/deployment/bind/registered-model/script
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ cat databricks.yml
trace $CLI schemas create ${SCHEMA_NAME} ${CATALOG_NAME} | jq '{full_name, catalog_name}'

# Create a pre-defined registered model:
MODEL_FULL_NAME=$($CLI registered-models create "${CATALOG_NAME}" "${SCHEMA_NAME}" "${MODEL_NAME}" | jq -r '.full_name')
REGISTERED_MODEL_DEF="{\"name\": \"${MODEL_NAME}\", \"catalog_name\": \"${CATALOG_NAME}\", \"schema_name\": \"${SCHEMA_NAME}\"}"
MODEL_FULL_NAME=$($CLI registered-models create --json "${REGISTERED_MODEL_DEF}" | jq -r '.full_name')

cleanup() {
trace $CLI registered-models delete "${MODEL_FULL_NAME}"
Expand Down
47 changes: 31 additions & 16 deletions acceptance/bundle/refschema/out.fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ resources.apps.*.app_status *apps.ApplicationStatus ALL
resources.apps.*.app_status.message string ALL
resources.apps.*.app_status.state apps.ApplicationState ALL
resources.apps.*.budget_policy_id string ALL
resources.apps.*.compute_size apps.ComputeSize ALL
resources.apps.*.compute_status *apps.ComputeStatus ALL
resources.apps.*.compute_status.message string ALL
resources.apps.*.compute_status.state apps.ComputeState ALL
Expand Down Expand Up @@ -113,6 +114,10 @@ resources.apps.*.resources[*].database.database_name string ALL
resources.apps.*.resources[*].database.instance_name string ALL
resources.apps.*.resources[*].database.permission apps.AppResourceDatabaseDatabasePermission ALL
resources.apps.*.resources[*].description string ALL
resources.apps.*.resources[*].genie_space *apps.AppResourceGenieSpace ALL
resources.apps.*.resources[*].genie_space.name string ALL
resources.apps.*.resources[*].genie_space.permission apps.AppResourceGenieSpaceGenieSpacePermission ALL
resources.apps.*.resources[*].genie_space.space_id string ALL
resources.apps.*.resources[*].job *apps.AppResourceJob ALL
resources.apps.*.resources[*].job.id string ALL
resources.apps.*.resources[*].job.permission apps.AppResourceJobJobPermission ALL
Expand Down Expand Up @@ -416,12 +421,21 @@ resources.database_instances.*.child_instance_refs[*].name string ALL
resources.database_instances.*.child_instance_refs[*].uid string ALL
resources.database_instances.*.creation_time string ALL
resources.database_instances.*.creator string ALL
resources.database_instances.*.custom_tags []database.CustomTag ALL
resources.database_instances.*.custom_tags[*] database.CustomTag ALL
resources.database_instances.*.custom_tags[*].key string ALL
resources.database_instances.*.custom_tags[*].value string ALL
resources.database_instances.*.effective_capacity string ALL
resources.database_instances.*.effective_custom_tags []database.CustomTag ALL
resources.database_instances.*.effective_custom_tags[*] database.CustomTag ALL
resources.database_instances.*.effective_custom_tags[*].key string ALL
resources.database_instances.*.effective_custom_tags[*].value string ALL
resources.database_instances.*.effective_enable_pg_native_login bool ALL
resources.database_instances.*.effective_enable_readable_secondaries bool ALL
resources.database_instances.*.effective_node_count int ALL
resources.database_instances.*.effective_retention_window_in_days int ALL
resources.database_instances.*.effective_stopped bool ALL
resources.database_instances.*.effective_usage_policy_id string ALL
resources.database_instances.*.enable_pg_native_login bool ALL
resources.database_instances.*.enable_readable_secondaries bool ALL
resources.database_instances.*.id string INPUT
Expand Down Expand Up @@ -450,6 +464,7 @@ resources.database_instances.*.state database.DatabaseInstanceState ALL
resources.database_instances.*.stopped bool ALL
resources.database_instances.*.uid string ALL
resources.database_instances.*.url string INPUT
resources.database_instances.*.usage_policy_id string ALL
resources.experiments.*.artifact_location string ALL
resources.experiments.*.creation_time int64 REMOTE
resources.experiments.*.experiment_id string REMOTE
Expand Down Expand Up @@ -504,8 +519,6 @@ resources.jobs.*.environments[*].spec.client string INPUT STATE
resources.jobs.*.environments[*].spec.dependencies []string INPUT STATE
resources.jobs.*.environments[*].spec.dependencies[*] string INPUT STATE
resources.jobs.*.environments[*].spec.environment_version string INPUT STATE
resources.jobs.*.environments[*].spec.jar_dependencies []string INPUT STATE
resources.jobs.*.environments[*].spec.jar_dependencies[*] string INPUT STATE
resources.jobs.*.environments[*].spec.java_dependencies []string INPUT STATE
resources.jobs.*.environments[*].spec.java_dependencies[*] string INPUT STATE
resources.jobs.*.format jobs.Format INPUT STATE
Expand Down Expand Up @@ -695,8 +708,6 @@ resources.jobs.*.settings.environments[*].spec.client string REMOTE
resources.jobs.*.settings.environments[*].spec.dependencies []string REMOTE
resources.jobs.*.settings.environments[*].spec.dependencies[*] string REMOTE
resources.jobs.*.settings.environments[*].spec.environment_version string REMOTE
resources.jobs.*.settings.environments[*].spec.jar_dependencies []string REMOTE
resources.jobs.*.settings.environments[*].spec.jar_dependencies[*] string REMOTE
resources.jobs.*.settings.environments[*].spec.java_dependencies []string REMOTE
resources.jobs.*.settings.environments[*].spec.java_dependencies[*] string REMOTE
resources.jobs.*.settings.format jobs.Format REMOTE
Expand Down Expand Up @@ -2827,16 +2838,20 @@ resources.pipelines.*.trigger.cron.quartz_cron_schedule string INPUT STATE
resources.pipelines.*.trigger.cron.timezone_id string INPUT STATE
resources.pipelines.*.trigger.manual *pipelines.ManualTrigger INPUT STATE
resources.pipelines.*.url string INPUT
resources.registered_models.*.aliases []catalog.RegisteredModelAlias REMOTE
resources.registered_models.*.aliases[*] catalog.RegisteredModelAlias REMOTE
resources.registered_models.*.aliases[*].alias_name string REMOTE
resources.registered_models.*.aliases[*].version_num int REMOTE
resources.registered_models.*.browse_only bool REMOTE
resources.registered_models.*.aliases []catalog.RegisteredModelAlias ALL
resources.registered_models.*.aliases[*] catalog.RegisteredModelAlias ALL
resources.registered_models.*.aliases[*].alias_name string ALL
resources.registered_models.*.aliases[*].catalog_name string ALL
resources.registered_models.*.aliases[*].id string ALL
resources.registered_models.*.aliases[*].model_name string ALL
resources.registered_models.*.aliases[*].schema_name string ALL
resources.registered_models.*.aliases[*].version_num int ALL
resources.registered_models.*.browse_only bool ALL
resources.registered_models.*.catalog_name string ALL
resources.registered_models.*.comment string ALL
resources.registered_models.*.created_at int64 REMOTE
resources.registered_models.*.created_by string REMOTE
resources.registered_models.*.full_name string REMOTE
resources.registered_models.*.created_at int64 ALL
resources.registered_models.*.created_by string ALL
resources.registered_models.*.full_name string ALL
resources.registered_models.*.grants []resources.Grant INPUT
resources.registered_models.*.grants[*] resources.Grant INPUT
resources.registered_models.*.grants[*].principal string INPUT
Expand All @@ -2845,14 +2860,14 @@ resources.registered_models.*.grants[*].privileges[*] string INPUT
resources.registered_models.*.id string INPUT
resources.registered_models.*.lifecycle resources.Lifecycle INPUT
resources.registered_models.*.lifecycle.prevent_destroy bool INPUT
resources.registered_models.*.metastore_id string REMOTE
resources.registered_models.*.metastore_id string ALL
resources.registered_models.*.modified_status string INPUT
resources.registered_models.*.name string ALL
resources.registered_models.*.owner string REMOTE
resources.registered_models.*.owner string ALL
resources.registered_models.*.schema_name string ALL
resources.registered_models.*.storage_location string ALL
resources.registered_models.*.updated_at int64 REMOTE
resources.registered_models.*.updated_by string REMOTE
resources.registered_models.*.updated_at int64 ALL
resources.registered_models.*.updated_by string ALL
resources.registered_models.*.url string INPUT
resources.schemas.*.browse_only bool REMOTE
resources.schemas.*.catalog_name string ALL
Expand Down
16 changes: 0 additions & 16 deletions acceptance/bundle/run_as/allowed/regular_user/output.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

>>> [CLI] bundle validate -o json
Warning: required field "catalog_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7

Warning: required field "schema_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7


>>> jq .run_as
{
Expand Down Expand Up @@ -46,14 +38,6 @@ Warning: required field "schema_name" is not set
}

>>> [CLI] bundle validate -o json -t development
Warning: required field "catalog_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7

Warning: required field "schema_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7


>>> jq .run_as
{
Expand Down
16 changes: 0 additions & 16 deletions acceptance/bundle/run_as/allowed/service_principal/output.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

>>> [CLI] bundle validate -o json
Warning: required field "catalog_name" is not set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems odd that this warning is lost?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in accordance to this change - CatalogName got an omitempty attribute: databricks/databricks-sdk-go@42ad9a8#r167972266

at resources.registered_models.model_two
in databricks.yml:50:7

Warning: required field "schema_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7


>>> jq .run_as
{
Expand Down Expand Up @@ -46,14 +38,6 @@ Warning: required field "schema_name" is not set
}

>>> [CLI] bundle validate -o json -t development
Warning: required field "catalog_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7

Warning: required field "schema_name" is not set
at resources.registered_models.model_two
in databricks.yml:50:7


>>> jq .run_as
{
Expand Down
8 changes: 0 additions & 8 deletions acceptance/bundle/run_as/pipelines_legacy/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ Warning: You are using the legacy mode of run_as. The support for this mode is e
at experimental.use_legacy_run_as
in databricks.yml:8:22

Warning: required field "catalog_name" is not set
at resources.registered_models.model_two
in databricks.yml:59:7

Warning: required field "schema_name" is not set
at resources.registered_models.model_two
in databricks.yml:59:7


>>> jq .run_as
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ Warning: required field "name" is not set
}

=== resources.registered_models.rname ===
Warning: required field "catalog_name" is not set
at resources.registered_models.rname
in databricks.yml:6:12

Warning: required field "name" is not set
at resources.registered_models.rname
in databricks.yml:6:12

Warning: required field "schema_name" is not set
at resources.registered_models.rname
in databricks.yml:6:12

{
"registered_models": {
"rname": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ Warning: unknown field: grants
}

=== resources.registered_models.rname ===
Warning: required field "catalog_name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

Warning: required field "name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

Warning: required field "schema_name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

{
"registered_models": {
"rname": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ Warning: unknown field: permissions
at resources.registered_models.rname
in databricks.yml:7:7

Warning: required field "catalog_name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

Warning: required field "name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

Warning: required field "schema_name" is not set
at resources.registered_models.rname
in databricks.yml:7:7

{
"registered_models": {
"rname": {}
Expand Down
3 changes: 0 additions & 3 deletions acceptance/cmd/account/account-help/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ Usage:

Identity and Access Management
access-control These APIs manage access rules on resources in an account.
groups Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects.
groups-v2 Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects.
service-principals Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.
service-principals-v2 Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms.
users User identities recognized by Databricks and represented by email addresses.
users-v2 User identities recognized by Databricks and represented by email addresses.
workspace-assignment The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.

Expand Down
9 changes: 5 additions & 4 deletions acceptance/cmd/workspace/apps/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ Usage:
databricks apps update NAME [flags]

Flags:
--budget-policy-id string
--description string The description of the app.
-h, --help help for update
--json JSON either inline JSON string or @path/to/file.json with request body (default JSON (0 bytes))
--budget-policy-id string
--compute-size ComputeSize Supported values: [LARGE, LIQUID, MEDIUM]
--description string The description of the app.
-h, --help help for update
--json JSON either inline JSON string or @path/to/file.json with request body (default JSON (0 bytes))

Global Flags:
--debug enable debug logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Flags:
--node-count int The number of nodes in the instance, composed of 1 primary and 0 or more secondaries.
--retention-window-in-days int The retention window for the instance.
--stopped Whether to stop the instance.
--usage-policy-id string The desired usage policy to associate with the instance.

Global Flags:
--debug enable debug logging
Expand Down
12 changes: 11 additions & 1 deletion bundle/direct/dresources/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,17 @@ func testCRUD(t *testing.T, group string, adapter *Adapter, client *databricks.W
if remoteStateFromUpdate != nil {
remappedStateFromUpdate, err := adapter.RemapState(remoteStateFromUpdate)
require.NoError(t, err)
require.Equal(t, remappedState, remappedStateFromUpdate)
changes, err := structdiff.GetStructDiff(remappedState, remappedStateFromUpdate)
require.NoError(t, err)
// Filter out timestamp fields that are expected to differ in value
var relevantChanges []structdiff.Change
for _, change := range changes {
fieldName := change.Path.String()
if fieldName != "updated_at" {
relevantChanges = append(relevantChanges, change)
}
}
require.Empty(t, relevantChanges, "unexpected differences found: %v", relevantChanges)
}

remoteStateFromWaitUpdate, err := adapter.WaitAfterUpdate(ctx, newState)
Expand Down
22 changes: 22 additions & 0 deletions bundle/direct/dresources/registered_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ func (*ResourceRegisteredModel) RemapState(model *catalog.RegisteredModelInfo) *
SchemaName: model.SchemaName,
StorageLocation: model.StorageLocation,
ForceSendFields: filterFields[catalog.CreateRegisteredModelRequest](model.ForceSendFields),

Aliases: model.Aliases,
BrowseOnly: model.BrowseOnly,
CreatedAt: model.CreatedAt,
CreatedBy: model.CreatedBy,
FullName: model.FullName,
MetastoreId: model.MetastoreId,
Owner: model.Owner,
UpdatedAt: model.UpdatedAt,
UpdatedBy: model.UpdatedBy,
}
}

Expand Down Expand Up @@ -64,6 +74,18 @@ func (r *ResourceRegisteredModel) DoUpdate(ctx context.Context, id string, confi
// Name updates are not supported yet without recreating. Can be added as a follow-up.
// Note: TF also does not support changing name without a recreate so the current behavior matches TF.
NewName: "",

Aliases: config.Aliases,
BrowseOnly: config.BrowseOnly,
CreatedAt: config.CreatedAt,
CreatedBy: config.CreatedBy,
MetastoreId: config.MetastoreId,
UpdatedAt: config.UpdatedAt,
UpdatedBy: config.UpdatedBy,
SchemaName: config.SchemaName,
StorageLocation: config.StorageLocation,
Name: config.Name,
CatalogName: config.CatalogName,
}

response, err := r.client.RegisteredModels.Update(ctx, updateRequest)
Expand Down
Loading
Loading