-
Notifications
You must be signed in to change notification settings - Fork 461
[Fix] Correctly handling tags update in databricks_sql_endpoint
#5060
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
base: main
Are you sure you want to change the base?
Conversation
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
There was a problem hiding this 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
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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 locallydocs/
folderinternal/acceptance
NEXT_CHANGELOG.md
file