Skip to content

Commit 89b7e3e

Browse files
authored
---
yaml --- r: 17575 b: refs/heads/autosynth-texttospeech c: ea68410 h: refs/heads/master i: 17573: 0caeb8b 17571: 5a4eb54 17567: 0d29fb9
1 parent ef9b367 commit 89b7e3e

6 files changed

Lines changed: 30 additions & 166 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ refs/heads/autosynth-securitycenter: 8e95447ccb176c3648880ee0cb926cd1f4065156
143143
refs/heads/autosynth-spanner: 9bff86d057df31e04c76d72865e8e073ac5794fb
144144
refs/heads/autosynth-speech: 75d6c62a9d07d3a3642980502a25d07fbde0f232
145145
refs/heads/autosynth-tasks: b0cdb991f3f75345151a3f68db1aab273dfc069b
146-
refs/heads/autosynth-texttospeech: 0e26ec9b0ed5bbedc038dea32bbb44bae0883668
146+
refs/heads/autosynth-texttospeech: ea68410f175b64ab06ff8bd1371935d12e3ce3e9
147147
refs/heads/autosynth-trace: 80c58aa2fb54b0a9c6876f2c21aa8d19cf55962e
148148
refs/heads/autosynth-websecurityscanner: d4febbffb6c648b74faec62fe90e20adadc9a7d3
149149
refs/heads/bigquerystorage: 06db74d123d7f8a3ef48755c2fcabed09faf8e64

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Schema.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21+
import com.google.api.services.bigquery.model.TableFieldSchema;
2122
import com.google.api.services.bigquery.model.TableSchema;
2223
import com.google.common.base.Function;
2324
import com.google.common.base.MoreObjects;
2425
import java.io.Serializable;
26+
import java.util.Collections;
27+
import java.util.List;
2528
import java.util.Objects;
2629

2730
/** This class represents the schema for a Google BigQuery Table or data source. */
@@ -90,6 +93,10 @@ TableSchema toPb() {
9093
}
9194

9295
static Schema fromPb(com.google.api.services.bigquery.model.TableSchema tableSchemaPb) {
93-
return Schema.of(FieldList.fromPb(tableSchemaPb.getFields()));
96+
List<TableFieldSchema> fields = tableSchemaPb.getFields();
97+
if (fields == null) {
98+
fields = Collections.emptyList();
99+
}
100+
return Schema.of(FieldList.fromPb(fields));
94101
}
95102
}

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static org.junit.Assert.assertEquals;
2020

21+
import com.google.api.services.bigquery.model.TableSchema;
2122
import com.google.common.collect.ImmutableList;
2223
import java.util.List;
2324
import org.junit.Test;
@@ -57,4 +58,11 @@ private void compareTableSchema(Schema expected, Schema value) {
5758
assertEquals(expected, value);
5859
assertEquals(expected.getFields(), value.getFields());
5960
}
61+
62+
@Test
63+
public void testEmptySchema() {
64+
TableSchema tableSchema = new TableSchema();
65+
Schema schema = Schema.fromPb(tableSchema);
66+
assertEquals(0, schema.getFields().size());
67+
}
6068
}

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-texttospeech/src/test/java/com/google/cloud/texttospeech/v1/TextToSpeechSmokeTest.java

Lines changed: 0 additions & 68 deletions
This file was deleted.

branches/autosynth-texttospeech/google-cloud-clients/google-cloud-texttospeech/src/test/java/com/google/cloud/texttospeech/v1beta1/TextToSpeechSmokeTest.java

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,27 @@
11
{
2-
"updateTime": "2019-01-12T08:51:17.352312Z",
32
"sources": [
4-
{
5-
"generator": {
6-
"name": "artman",
7-
"version": "0.16.5",
8-
"dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c"
9-
}
10-
},
113
{
124
"git": {
135
"name": "googleapis",
146
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "2156b3490f9fe4d79bcb34754a3aaed7ea52114d",
16-
"internalRef": "228970571"
7+
"sha": "5a57f0c13a358b2b15452bf2d67453774a5f6d4f",
8+
"internalRef": "221837528"
179
}
18-
}
19-
],
20-
"destinations": [
10+
},
2111
{
22-
"client": {
23-
"source": "googleapis",
24-
"apiName": "texttospeech",
25-
"apiVersion": "v1",
26-
"language": "java",
27-
"generator": "gapic",
28-
"config": "google/cloud/texttospeech/artman_texttospeech_v1.yaml"
12+
"git": {
13+
"name": "googleapis-private",
14+
"remote": "https://github.com/googleapis/googleapis-private.git",
15+
"sha": "6aa8e1a447bb8d0367150356a28cb4d3f2332641",
16+
"internalRef": "221340946"
2917
}
3018
},
3119
{
32-
"client": {
33-
"source": "googleapis",
34-
"apiName": "texttospeech",
35-
"apiVersion": "v1beta1",
36-
"language": "java",
37-
"generator": "gapic",
38-
"config": "google/cloud/texttospeech/artman_texttospeech_v1beta1.yaml"
20+
"generator": {
21+
"name": "artman",
22+
"version": "0.16.0",
23+
"dockerImage": "googleapis/artman@sha256:90f9d15e9bad675aeecd586725bce48f5667ffe7d5fc4d1e96d51ff34304815b"
3924
}
4025
}
4126
]
42-
}
27+
}

0 commit comments

Comments
 (0)