Skip to content

Conversation

alexott
Copy link
Contributor

@alexott alexott commented Sep 27, 2025

Changes

When updating tags of SQL Warehouse completely removing it, the reflect functionality incorrectly handled the case and tried to send an empty JSON object. This is fixed in current PR.

Resolves #5051

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework
  • has entry in NEXT_CHANGELOG.md file

When updating tags of SQL Warehouse completely removing it, the reflect functionality
incorrectly handled the case and tried to send an empty JSON object.  This is fixed in
current PR.

Resolves #5051
@alexott alexott requested review from a team as code owners September 27, 2025 11:58
@alexott alexott requested review from rauchy and removed request for a team September 27, 2025 11:58
@alexott alexott requested a review from Copilot September 27, 2025 11:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the databricks_sql_endpoint resource where updating tags and completely removing them incorrectly sent empty JSON objects to the API instead of omitting them entirely.

  • Adds filtering logic to skip empty structs when processing collections in the reflect functionality
  • Implements isStructEmpty helper function to detect structs with all zero values
  • Comprehensive test coverage for the new empty struct filtering behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
common/reflect_resource.go Adds isStructEmpty function and modifies readListFromData to filter out empty structs
common/reflect_resource_test.go Adds comprehensive tests for isStructEmpty and empty struct filtering in readListFromData
NEXT_CHANGELOG.md Documents the bug fix for tags update handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Fix misleading comment about validation checking for non-struct types
- Replace direct strconv.Itoa function parameter with proper lambda function
- Ensure code clarity and maintainability
@alexott alexott requested a review from Copilot September 29, 2025 07:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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: 5060
  • Commit SHA: 499d3765fc261761cb5cbbff0cef27218c8334a9

Checks will be approved automatically on success.

@tanmay-db tanmay-db self-requested a review October 1, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ISSUE] Removing tags from databricks_sql_endpoint fails
1 participant