@@ -230,7 +230,7 @@ func TestAccBigQueryTable_HivePartitioning(t *testing.T) {
230
230
})
231
231
}
232
232
233
- func TestAccBigQueryTable_HivePartitioningCustomSchema (t * testing.T ) {
233
+ func TestAccBigQueryTable_HivePartitioningCustomSchema_update (t * testing.T ) {
234
234
t .Parallel ()
235
235
bucketName := acctest .TestBucketName (t )
236
236
resourceName := "google_bigquery_table.test"
@@ -243,13 +243,22 @@ func TestAccBigQueryTable_HivePartitioningCustomSchema(t *testing.T) {
243
243
CheckDestroy : testAccCheckBigQueryTableDestroyProducer (t ),
244
244
Steps : []resource.TestStep {
245
245
{
246
- Config : testAccBigQueryTableHivePartitioningCustomSchema (bucketName , datasetID , tableID ),
246
+ Config : testAccBigQueryTableHivePartitioningCustomSchema (bucketName , datasetID , tableID , "old-label" ),
247
247
},
248
248
{
249
249
ResourceName : resourceName ,
250
250
ImportState : true ,
251
251
ImportStateVerify : true ,
252
- ImportStateVerifyIgnore : []string {"external_data_configuration.0.schema" , "deletion_protection" },
252
+ ImportStateVerifyIgnore : []string {"external_data_configuration.0.schema" , "labels" , "deletion_protection" },
253
+ },
254
+ {
255
+ Config : testAccBigQueryTableHivePartitioningCustomSchema (bucketName , datasetID , tableID , "new-label" ),
256
+ },
257
+ {
258
+ ResourceName : resourceName ,
259
+ ImportState : true ,
260
+ ImportStateVerify : true ,
261
+ ImportStateVerifyIgnore : []string {"external_data_configuration.0.schema" , "labels" , "deletion_protection" },
253
262
},
254
263
},
255
264
})
@@ -2131,7 +2140,7 @@ resource "google_bigquery_table" "test" {
2131
2140
` , bucketName , datasetID , tableID )
2132
2141
}
2133
2142
2134
- func testAccBigQueryTableHivePartitioningCustomSchema (bucketName , datasetID , tableID string ) string {
2143
+ func testAccBigQueryTableHivePartitioningCustomSchema (bucketName , datasetID , tableID , tableLabel string ) string {
2135
2144
return fmt .Sprintf (`
2136
2145
resource "google_storage_bucket" "test" {
2137
2146
name = "%s"
@@ -2154,6 +2163,10 @@ resource "google_bigquery_table" "test" {
2154
2163
table_id = "%s"
2155
2164
dataset_id = google_bigquery_dataset.test.dataset_id
2156
2165
2166
+ labels = {
2167
+ label = "%s"
2168
+ }
2169
+
2157
2170
external_data_configuration {
2158
2171
source_format = "NEWLINE_DELIMITED_JSON"
2159
2172
autodetect = false
@@ -2180,7 +2193,7 @@ EOH
2180
2193
}
2181
2194
depends_on = ["google_storage_bucket_object.test"]
2182
2195
}
2183
- ` , bucketName , datasetID , tableID )
2196
+ ` , bucketName , datasetID , tableID , tableLabel )
2184
2197
}
2185
2198
2186
2199
func testAccBigQueryTableAvroPartitioning (bucketName , avroFilePath , datasetID , tableID string ) string {
0 commit comments