Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] Unity catalog update owner sending full payload #1351

Closed
hubertpham95 opened this issue Jun 2, 2022 · 1 comment · Fixed by #1338
Closed

[ISSUE] Unity catalog update owner sending full payload #1351

hubertpham95 opened this issue Jun 2, 2022 · 1 comment · Fixed by #1338
Labels
feature New feature or request

Comments

@hubertpham95
Copy link

hubertpham95 commented Jun 2, 2022

When changing the owner for databricks_schema resource, an error is thrown because the Databricks Terraform provider is sending a full payload instead of just the owner field.

Configuration

resource "databricks_schema" "sandbox_schemas" {
  for_each     = module.group_config.group_config_global
  provider     = databricks.workspace
  catalog_name = databricks_catalog.sandbox.id
  name         = replace(each.key, "-", "_")
  owner        = each.value.okta_name
  comment      = "ACL group schema"
  properties   = {
    kind = "various"
  }
}

Expected Behavior

Owner for the databricks_schema resource should be updated without any issues.

Actual Behavior

The following error is thrown:
Error: cannot update schema: UpdateSchema name or owner cannot be updated with other fields.

Steps to Reproduce

  1. Create databricks_schema resource
  2. Change the owner field

Terraform and provider versions

Terraform v1.0.8
on darwin_arm64
+ provider registry.terraform.io/databrickslabs/databricks v0.5.9

Debug Output

module.databricks_unity_catalog.databricks_schema.sandbox_schemas["content-marketing"]: Modifying... [id=sandbox.content_marketing]
2022-06-02T09:58:14.275-0700 [INFO]  Starting apply for module.databricks_unity_catalog.databricks_schema.sandbox_schemas["content-marketing"]
2022-06-02T09:58:14.276-0700 [DEBUG] module.databricks_unity_catalog.databricks_schema.sandbox_schemas["content-marketing"]: applying the planned Update change
2022-06-02T09:58:14.290-0700 [DEBUG] provider.terraform-provider-databricks_v0.5.9: PATCH /api/2.0/unity-catalog/schemas/sandbox.marketing {
  "catalog_name": "sandbox",
  "comment": "ACL group schema",
  "full_name": "sandbox.marketing",
  "metastore_id": "43862f49-20d3-4f58-bab4-476789d5de25",
  "name": "marketing",
  "owner": "ACL:Databricks:GEN2:Marketing",
  "properties": {
    "kind": "various"
  }
}: timestamp=2022-06-02T09:58:14.290-0700
2022-06-02T09:58:14.333-0700 [DEBUG] provider.terraform-provider-databricks_v0.5.9: 400 Bad Request {
  "error_code": "INVALID_PARAMETER_VALUE",
  "message": "UpdateSchema name or owner cannot be updated with other fields."
}: timestamp=2022-06-02T09:58:14.333-0700
2022-06-02T09:58:14.333-0700 [WARN]  provider.terraform-provider-databricks_v0.5.9: /api/2.0/unity-catalog/schemas/sandbox.finance:400 - UpdateSchema name or owner cannot be updated with other fields.: timestamp=2022-06-02T09:58:14.333-0700
2022-06-02T09:58:14.333-0700 [WARN]  provider.terraform-provider-databricks_v0.5.9: /api/2.0/unity-catalog/schemas/sandbox.finance:400 - UpdateSchema name or owner cannot be updated with other fields.: timestamp=2022-06-02T09:58:14.333-0700
@nfx nfx linked a pull request Jun 2, 2022 that will close this issue
@nfx
Copy link
Contributor

nfx commented Jun 2, 2022

releasing #1338 will address this

@nfx nfx added the feature New feature or request label Jun 2, 2022
nkvuong added a commit to nkvuong/terraform-provider-databricks that referenced this issue Jun 3, 2022
@nfx nfx closed this as completed in #1338 Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants