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 schema_column for azurerm_data_factory_dataset_snowflake resource #13344

Conversation

orestiskats19
Copy link
Contributor

@orestiskats19 orestiskats19 commented Sep 14, 2021

Acceptance Tests:

make acctests SERVICE='datafactory/data_factory_dataset_snowflake_resource_test.go' TEST
TIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/datafactory/data_factory_dataset_snowflake_resource_test.go  -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataFactoryDatasetSnowflake_basic
=== PAUSE TestAccDataFactoryDatasetSnowflake_basic
=== RUN   TestAccDataFactoryDatasetSnowflake_update
=== PAUSE TestAccDataFactoryDatasetSnowflake_update
=== CONT  TestAccDataFactoryDatasetSnowflake_basic
=== CONT  TestAccDataFactoryDatasetSnowflake_update
--- PASS: TestAccDataFactoryDatasetSnowflake_basic (265.45s)
--- PASS: TestAccDataFactoryDatasetSnowflake_update (319.66s)
PASS
ok      command-line-arguments  320.973s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks for this fix @orestiskats19 - have a couple quesions/comments i've left inline

Comment on lines 124 to 138
"Byte",
"Byte[]",
"Boolean",
"Date",
"DateTime",
"DateTimeOffset",
"Decimal",
"Double",
"Guid",
"Int16",
"Int32",
"Int64",
"Single",
"String",
"TimeSpan",
Copy link
Collaborator

Choose a reason for hiding this comment

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

we cannot remove these until 3.0 - can we add a comment to that affect and leave these in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing my PR @katbyte. Why we can't replace those with the right data types of Snowflake? Don't think it works as it is now...

Copy link
Collaborator

@katbyte katbyte Sep 17, 2021

Choose a reason for hiding this comment

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

someone might have a confid with it somewhere, that maybe hasn't run for a while and used to work and the API is returning these old values - we don't want tf to suddenly fail so we need to keep them around until 3.0 (which is in the next 6 months) - as such this would be a breaking change we can only make then

}, false),
},
"description": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

how come we are removing the description property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems that the description property is used only for the structure column (used in other resources) and not for the snowflake schema column. For every column in Snowflake the properties are name, type, precision and scale.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ahh ok. as above removing this is a breaking change even if it currently does nothing, could we instead deprecate it and we'll remove it in 3.0 - thanks!

@orestiskats19
Copy link
Contributor Author

Thanks @katbyte. I did a step back and made it backwards compatible with structure column. It is renamed now from schema_column to structure_column.

Acceptance tests:

==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/datafactory/data_factory_dataset_snowflake_resource_test.go  -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataFactoryDatasetSnowflake_basic
=== PAUSE TestAccDataFactoryDatasetSnowflake_basic
=== RUN   TestAccDataFactoryDatasetSnowflake_update
=== PAUSE TestAccDataFactoryDatasetSnowflake_update
=== CONT  TestAccDataFactoryDatasetSnowflake_basic
=== CONT  TestAccDataFactoryDatasetSnowflake_update
--- PASS: TestAccDataFactoryDatasetSnowflake_basic (221.14s)
--- PASS: TestAccDataFactoryDatasetSnowflake_update (303.24s)
PASS
ok      command-line-arguments  304.599s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @orestiskats19 - overall looks great! however i'm guessing the intent is to replace the old colum with the new one so we should probably deprecate it and point users to the new one?

@@ -107,7 +107,7 @@ func resourceDataFactoryDatasetSnowflake() *pluginsdk.Resource {
},
},

"schema_column": {
"structure_column": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should probably deprecate this property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @katbyte, I added the deprecated warning.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes @orestiskats19 - this LGTM now 🚀

@katbyte
Copy link
Collaborator

katbyte commented Sep 23, 2021

For some additional context - after merge when preparing the changelog message i realized this is a breaking change as the wrong block was being assigned to the wrong property. After toying with changing it/reverting it back to its mostly broken state we decided to keep this as is and detail it in the upgrade notes. If you wish to retain the old behaviour please change schema_column to structure_column.

katbyte added a commit that referenced this pull request Sep 23, 2021
@github-actions
Copy link

This functionality has been released in v2.78.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants