Skip to content

DAB cannot create mlflow model: Missing required field: tag value when targets is development mode #922

@Hydrugion

Description

@Hydrugion

Databricks CLI version

$ databricks -v                    
Databricks CLI v0.208.2

Bug reproduction

When deploying a model resource to a target with development mode, the automatic tagging mechanism added a tag that does not comply to Databricks create model API and caused the following error

$ databricks bundle deploy

Starting upload of bundle files
Uploaded bundle files at /Users/<redacted>/.bundle/test-dab/dev/files!

Starting resource deployment
Error: terraform apply: exit status 1                                       
                                                                            
Error: cannot create mlflow model: Missing required field: tag value        
                                                                            
  with databricks_mlflow_model.test_model,                                  
  on bundle.tf.json line 22, in resource.databricks_mlflow_model.test_model:
  22:       } 

File databricks.yml

bundle:
  name: test-dab

targets:
  dev:
    mode: development
    default: true

resources:
  models:
    test_model:
      name: test-model

File bundle.tf.json output from databricks bundle validate

{
  "terraform": {
    "required_providers": {
      "databricks": {
        "source": "databricks/databricks",
        "version": "1.28.0"
      }
    }
  },
  "provider": {
    "databricks": {}
  },
  "resource": {
    "databricks_mlflow_model": {
      "test_model": {
        "name": "[dev <redacted>] test-model",
        "tags": [
          {
            "key": "dev"
          }
        ]
      }
    }
  }
}

From the file we can observe that the tags "key": "dev" does not have a value that caused the error. For production mode there is no automatic tag added so no error is raised.

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingDABsDABs related issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions