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

[Fix] mws workspaces mishandling empty response #4414

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VenelinMartinov
Copy link

Changes

This PR fixes the databricks_mws_workspaces datasource to correctly return an empty list when no mws workspaces are configured. It would previously return a nil, which caused certain Terraform programs to misbehave.

For example this would error instead of correctly returning 0:

data "databricks_mws_workspaces" "example" {}

output "workspace_ids" {
  value = data.databricks_mws_workspaces.example.ids
}

output "workspace_count" {
  value = length(data.databricks_mws_workspaces.example.ids)
}

Tests

I've added a test similar to the existing tests for the mws_workspaces data source

@VenelinMartinov VenelinMartinov requested review from a team as code owners January 17, 2025 14:04
@VenelinMartinov VenelinMartinov requested review from hectorcast-db and removed request for a team January 17, 2025 14:04
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4414
  • Commit SHA: 9e9c8d9b3a921b98e6317c9a9e488e0648fd5d1f

Checks will be approved automatically on success.

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants