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

Fixed databricks_table update for column block #1468

Merged
merged 4 commits into from
Jul 20, 2022
Merged

Conversation

nkvuong
Copy link
Contributor

@nkvuong nkvuong commented Jul 15, 2022

Close #1455

There must be a more programmatic way to do this...

@alexott alexott requested a review from a team July 18, 2022 06:52
if !d.HasChange(field) {

var old, new interface{}
if field == "columns" {
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it be simpler to do:

if field == "columns" {
  field = "column"
}
old, new = d.GetChange(field)
if !d.HasChange(field) {
  continue
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the API expect columns in the payload however

}

//ignore storage_location for MANAGED tables
if field == "storage_location" && d.Get("table_type") != "EXTERNAL" {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be handled as suppress diff?
Also, should we handle the case when people will change from managed to external?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

table_type cannot be updated

@codecov-commenter
Copy link

Codecov Report

Merging #1468 (3e30598) into master (734ef36) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1468   +/-   ##
=======================================
  Coverage   90.11%   90.12%           
=======================================
  Files         126      126           
  Lines       10208    10218   +10     
=======================================
+ Hits         9199     9209   +10     
  Misses        642      642           
  Partials      367      367           
Impacted Files Coverage Δ
catalog/resource_table.go 100.00% <100.00%> (ø)
catalog/update.go 100.00% <100.00%> (ø)

@nfx nfx force-pushed the fix/uc_table_update branch from 3e30598 to 5650c6b Compare July 20, 2022 08:27
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

👍

@nfx nfx changed the title Fix UC table update logic Fixed external databricks_table update for column block Jul 20, 2022
@nfx nfx changed the title Fixed external databricks_table update for column block Fixed databricks_table update for column block Jul 20, 2022
@nfx nfx merged commit 88b85d2 into master Jul 20, 2022
@nfx nfx deleted the fix/uc_table_update branch July 20, 2022 11:37
@nfx nfx mentioned this pull request Jul 21, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
* fix and simplify update table logic
* fix managed table update logic
* add suppress_diff to table location
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.

[ISSUE] Updates to Unity table columns don't seem to take effect
4 participants