-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
azurerm_data_factory_dataset_{cosmosdb_sqlapi|mysql|postgresql}
- Fix incorrect type/error message during read
#22438
azurerm_data_factory_dataset_{cosmosdb_sqlapi|mysql|postgresql}
- Fix incorrect type/error message during read
#22438
Conversation
…ix incorrect type/error message during read
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.
Hey @magodo, this is looking in the right direction but it also breaks one of the resources. It also looks like the resources weren't built correctly either as the mysql dataset is being built as a relational dataset rather than a mysql one. It looks to be the same for the postgresql dataset as well
@@ -249,7 +249,7 @@ func resourceDataFactoryDatasetPostgreSQLRead(d *pluginsdk.ResourceData, meta in | |||
d.Set("name", id.Name) | |||
d.Set("data_factory_id", dataFactoryId.ID()) | |||
|
|||
postgresqlTable, ok := resp.Properties.AsRelationalTableDataset() | |||
postgresqlTable, ok := resp.Properties.AsPostgreSQLTableDataset() |
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.
This breaks the resource
Error: classifying Data Factory Dataset PostgreSQL Data Set: (Name "acctestds230710174416108434" / Factory Name "acctestdf230710174416108434" / Resource Group "acctestRG-df-230710174416108434"): Expected: "PostgreSqlTable" Received: "Microsoft.DataFactory/factories/datasets"
Thank you @mbfrahry for the feedback! I was mislead by terraform-provider-azurerm/internal/services/datafactory/data_factory_dataset_postgresql_resource.go Lines 212 to 216 in e9b1698
Type property at the top level is actually thrown away during Marshalling:
This brings me to wonder whether postgresql data set is actually implemented as expected, as it is now using the same type as the mysql dataset... Regardlessly, I've also updated the error message to make it useful, otherwise, the "Expect" always print the same (useless) resource type, instead of the variant type. |
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.
Yea...I'm not sure if the underlying model changed or the resource was written incorrectly(by me 🙈) but mysql and postgresql definitely look to be using the wrong model.
But these error messages look better so we can move forward with this! Thanks @magodo
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. |
azurerm_data_factory_dataset_{cosmosdb_sqlapi|mysql|postgresql}
- Fix incorrect type/error message during read