databricks / cli

Databricks CLI
Other
150 stars 56 forks source link

Error multiple resources have been defined with the same key #1923

Closed ibozhu closed 5 days ago

ibozhu commented 5 days ago

Describe the issue

It seems like using the same key under different resource types is not supported. For example:

image

Configuration

Define a job resource like:

image

Also define a schema resource like:

image

Steps to reproduce the behavior

  1. Define above 2 resources
  2. Run databricks bundle validate
  3. See error

Expected Behavior

Same key should be allowed under different resource types

Actual Behavior

Same key is currently not allowed under different resource types

OS and CLI version

Databricks CLI v0.230.0 on MacOS 14.7.1

Is this a regression?

Not sure if it was supported in previous versions or not.

Debug Logs

pietern commented 5 days ago

Thanks for posting the issue.

This is expected behavior. We check uniqueness because it can lead to ambiguous resource references in the context of bundle run or bundle summary. You can work around this by using unique keys.