-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 error drop column with BigQuery flexible column names #12626
Conversation
Signed-off-by: kataoka-ayumu <[email protected]>
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
droppedColumnsString := strings.Join(droppedColumns, ", DROP COLUMN ") | ||
backquotedDroppedColumns := []string{} | ||
for _, column := range droppedColumns { | ||
backquotedDroppedColumns = append(backquotedDroppedColumns, fmt.Sprintf("`%s`", column)) | ||
} | ||
droppedColumnsString := strings.Join(backquotedDroppedColumns, ", DROP COLUMN ") |
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.
If droppedColumns = []string("column1", "column2")
,
backquotedDroppedColumns = []string("`column1`", "`column2`")
droppedColumnsString = "`column1`, DROP COLUMN `column2`"
dropColumnsDDL = "ALTER TABLE <table_id> DROP Column `column1`, DROP COLUMN `column2`"
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 128 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
Thank you for the fix! Can you also update the test in magic-modules/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go.tmpl Line 114 in 1a28a91
|
@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
The test results revealed that the cause of this error is not a reserved word, but rather the use of flexible column name with a dash character. Therefore, I added tests and update of the issue and PR. e.g.
|
Signed-off-by: kataoka-ayumu <[email protected]>
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go.tmpl
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go.tmpl
Outdated
Show resolved
Hide resolved
@GoogleCloudPlatform/terraform-team @shuyama1 This PR has been waiting for review for 1 week. Please take a look! Use the label |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 128 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
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.
One comment about indentation otherwise looks good, thank you
@wj-chen |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 128 Click here to see the affected service packages
🟢 All tests passed! View the build log |
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.
Thank you!
…dPlatform#12626) Signed-off-by: kataoka-ayumu <[email protected]>
Fix: hashicorp/terraform-provider-google#20750
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.