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] type issue in databricks_sql_table #4422

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

Conversation

ian-norris-ncino
Copy link

@ian-norris-ncino ian-norris-ncino commented Jan 21, 2025

Changes

Updated type check to only compare the first word in the type string.

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework

@ian-norris-ncino ian-norris-ncino requested review from a team as code owners January 21, 2025 19:34
@ian-norris-ncino ian-norris-ncino requested review from parthban-db and removed request for a team January 21, 2025 19:34
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: 4422
  • Commit SHA: 1bfbdafb7042348e68ed8280e3c8b73a11ae4587

Checks will be approved automatically on success.

@alexott alexott changed the title Fix type issue in databricks_sql_table [Fix] type issue in databricks_sql_table Jan 22, 2025
@@ -540,10 +540,11 @@ var columnTypeAliases = map[string]string{

func getColumnType(columnType string) string {
caseInsensitiveColumnType := strings.ToLower(columnType)
if alias, ok := columnTypeAliases[caseInsensitiveColumnType]; ok {
normalizedColumnType := strings.Split(caseInsensitiveColumnType, " ")[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we strip spaces from the string? Just to avoid the potential problem when a user puts a space into type?

Can we also add a unit test for this function? It will detect code problems earlier, without need to run a full integration test suite.

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