From 050e708606e662adc5aa5705bbf8715f3d1e3686 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Apr 2020 11:23:18 -0700 Subject: [PATCH 1/7] changes without context (#301) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 4 ++-- synth.metadata | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b7b5f81b6..d71201d05a 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.111.2' +compile 'com.google.cloud:google-cloud-bigquery:1.111.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.111.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.111.1" ``` [//]: # ({x-version-update-end}) diff --git a/synth.metadata b/synth.metadata index 3da64aa088..bcc7637a9b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9d37e45bc07de3d6b4fb2aac4c69df7b2ef80c9f" + "sha": "2b319ce21e2f540b7de4dfcef02c68a6cf8a1564" } }, { From 6315842dfa62a433a1ba507b861cf96a3d7cb03d Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Fri, 1 May 2020 21:26:43 +0530 Subject: [PATCH 2/7] fix: null type in timepartitioning frompb (#305) --- .../bigquery/StandardTableDefinition.java | 11 ------- .../cloud/bigquery/TimePartitioning.java | 2 +- .../cloud/bigquery/BigQueryImplTest.java | 32 ++++++++++++++++++- .../bigquery/StandardTableDefinitionTest.java | 28 ---------------- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java index 1c465343a5..4e26f831f1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java @@ -285,17 +285,6 @@ static StandardTableDefinition fromPb(Table tablePb) { + " in table " + tablePb.getTableReference().getTableId(), e); - } catch (NullPointerException e) { - throw new NullPointerException( - "Null pointer - Got unexpected time partitioning " - + tablePb.getTimePartitioning().toString() - + " in project " - + tablePb.getTableReference().getProjectId() - + " in dataset " - + tablePb.getTableReference().getDatasetId() - + " in table " - + tablePb.getTableReference().getTableId() - + e.toString()); } } if (tablePb.getRangePartitioning() != null) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java index dd9d4a73cb..43f3421294 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TimePartitioning.java @@ -142,7 +142,7 @@ static TimePartitioning fromPb( if (Data.isNull(expirationMs)) { expirationMs = null; } - return newBuilder(Type.valueOf(partitioningPb.getType())) + return newBuilder(Type.valueOf(firstNonNull(partitioningPb.getType(), Type.DAY.name()))) .setExpirationMs(expirationMs) .setField(partitioningPb.getField()) .setRequirePartitionFilter(partitioningPb.getRequirePartitionFilter()) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 7ab3e8ef28..999ea9a03b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -116,11 +116,22 @@ public class BigQueryImplTest { private static final Long TABLE_CREATION_TIME = 1546275600000L; private static final TimePartitioning TIME_PARTITIONING = TimePartitioning.of(TimePartitioning.Type.DAY, EXPIRATION_MS); + private static final com.google.api.services.bigquery.model.TimePartitioning PB_TIMEPARTITIONING = + new com.google.api.services.bigquery.model.TimePartitioning() + .setType(null) + .setField("timestampField"); + private static final TimePartitioning TIME_PARTITIONING_NULL_TYPE = + TimePartitioning.fromPb(PB_TIMEPARTITIONING); private static final StandardTableDefinition TABLE_DEFINITION_WITH_PARTITIONING = StandardTableDefinition.newBuilder() .setSchema(TABLE_SCHEMA) .setTimePartitioning(TIME_PARTITIONING) .build(); + private static final StandardTableDefinition TABLE_DEFINITION_WITH_PARTITIONING_NULL_TYPE = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(TIME_PARTITIONING_NULL_TYPE) + .build(); private static final RangePartitioning.Range RANGE = RangePartitioning.Range.newBuilder().setStart(1L).setInterval(2L).setEnd(10L).build(); private static final RangePartitioning RANGE_PARTITIONING = @@ -142,7 +153,10 @@ public class BigQueryImplTest { TableInfo.newBuilder(TABLE_ID, TABLE_DEFINITION_WITH_PARTITIONING) .setCreationTime(TABLE_CREATION_TIME) .build(); - + private static final TableInfo TABLE_INFO_WITH_PARTITIONS_NULL_TYPE = + TableInfo.newBuilder(TABLE_ID, TABLE_DEFINITION_WITH_PARTITIONING_NULL_TYPE) + .setCreationTime(TABLE_CREATION_TIME) + .build(); private static final ModelId OTHER_MODEL_ID = ModelId.of(DATASET, OTHER_MODEL); private static final ModelId MODEL_ID_WITH_PROJECT = ModelId.of(PROJECT, DATASET, MODEL); @@ -912,6 +926,22 @@ public void testListTablesReturnedParameters() { assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); } + @Test + public void testListTablesReturnedParametersNullType() { + bigquery = options.getService(); + ImmutableList tableList = + ImmutableList.of( + new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PARTITIONS_NULL_TYPE))); + Tuple> result = + Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); + EasyMock.expect(bigqueryRpcMock.listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS)) + .andReturn(result); + EasyMock.replay(bigqueryRpcMock); + Page
page = bigquery.listTables(DATASET, TABLE_LIST_PAGE_SIZE, TABLE_LIST_PAGE_TOKEN); + assertEquals(CURSOR, page.getNextPageToken()); + assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); + } + @Test public void testListTablesWithRangePartitioning() { bigquery = options.getService(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java index d1dd0cc29a..397e69d1ef 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java @@ -152,34 +152,6 @@ public void testFromPbWithUnexpectedTimePartitioningTypeRaisesInvalidArgumentExc fail("testFromPb illegal argument exception did not throw!"); } - @Test - public void testFromPbWithNullTimePartitioningTypeRaisesNullPointerException() { - Table invalidTable = - new Table() - .setType("TABLE") - .setTableReference( - new TableReference() - .setProjectId("NULL_PTR_TEST_PROJECT") - .setDatasetId("NULL_PTR_TEST_DATASET") - .setTableId("NULL_PTR_TEST_TABLE")) - .setTimePartitioning( - new com.google.api.services.bigquery.model.TimePartitioning().setType(null)); - try { - StandardTableDefinition.fromPb(invalidTable); - } catch (NullPointerException ne) { - assertThat( - ne.getMessage(), - allOf( - containsString("Null pointer - Got unexpected time partitioning"), - containsString("null"), - containsString("NULL_PTR_TEST_PROJECT"), - containsString("NULL_PTR_TEST_DATASET"), - containsString("NULL_PTR_TEST_TABLE"))); - return; - } - fail("testFromPb null pointer exception did not throw!"); - } - @Test public void testFromPbWithNullEstimatedRowsAndBytes() { StandardTableDefinition.fromPb( From fccb0b4d08b41e4836ac9490befca47306f14afd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 2 May 2020 09:59:05 +0200 Subject: [PATCH 3/7] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20200415-1.30.9 (#307) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72dbf5e7c0..68b4445431 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 1.4.4 1.3.2 1.18 - v2-rev20200324-1.30.9 + v2-rev20200415-1.30.9 1.7 ${auto-value.version} From 5a0ed060eb2c966092af66bfae2896ea8af70c7e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 4 May 2020 17:04:14 +0200 Subject: [PATCH 4/7] deps: update dependency com.google.auto.value:auto-value to v1.7.1 (#308) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68b4445431..a3954ce819 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 1.18 v2-rev20200415-1.30.9 - 1.7 + 1.7.1 ${auto-value.version} 1.0-rc6 From 74d7fc5075858f5c5aee398123f9d1523d731440 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 4 May 2020 20:28:48 +0200 Subject: [PATCH 5/7] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.111.2 (#311) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7c4826a39d..7b20949f6e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.111.1 + 1.111.2 From fc2abc851d62db2f0391669491478f43908e4946 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 14:52:39 -0400 Subject: [PATCH 6/7] chore: release 1.111.2-SNAPSHOT (#309) * updated versions.txt [ci skip] * updated google-cloud-bigquery/pom.xml [ci skip] * updated samples/snapshot/pom.xml [ci skip] * updated samples/install-without-bom/pom.xml [ci skip] * updated samples/pom.xml [ci skip] * updated samples/snippets/pom.xml [ci skip] * updated pom.xml [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1b7aefc602..2ea14406a0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.111.2 + 1.111.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.111.2 + 1.111.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a3954ce819..f30489d2b2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.111.2 + 1.111.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -116,7 +116,7 @@ com.google.cloud google-cloud-bigquery - 1.111.2 + 1.111.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f2a1f96a9b..4c7ef45fca 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.111.2 + 1.111.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 323882b01d..23122fd509 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.111.2:1.111.2 \ No newline at end of file +google-cloud-bigquery:1.111.2:1.111.3-SNAPSHOT \ No newline at end of file From 8e9ff2a847480ba7612229a20db348bdbd4092e2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 20:08:04 +0000 Subject: [PATCH 7/7] chore: release 1.111.3 (#313) :robot: I have created a release \*beep\* \*boop\* --- ### [1.111.3](https://www.github.com/googleapis/java-bigquery/compare/v1.111.2...v1.111.3) (2020-05-04) ### Bug Fixes * null type in timepartitioning frompb ([#305](https://www.github.com/googleapis/java-bigquery/issues/305)) ([6315842](https://www.github.com/googleapis/java-bigquery/commit/6315842dfa62a433a1ba507b861cf96a3d7cb03d)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20200415-1.30.9 ([#307](https://www.github.com/googleapis/java-bigquery/issues/307)) ([fccb0b4](https://www.github.com/googleapis/java-bigquery/commit/fccb0b4d08b41e4836ac9490befca47306f14afd)) * update dependency com.google.auto.value:auto-value to v1.7.1 ([#308](https://www.github.com/googleapis/java-bigquery/issues/308)) ([5a0ed06](https://www.github.com/googleapis/java-bigquery/commit/5a0ed060eb2c966092af66bfae2896ea8af70c7e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- CHANGELOG.md | 13 +++++++++++++ README.md | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a34faf5af..f4d277f8cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +### [1.111.3](https://www.github.com/googleapis/java-bigquery/compare/v1.111.2...v1.111.3) (2020-05-04) + + +### Bug Fixes + +* null type in timepartitioning frompb ([#305](https://www.github.com/googleapis/java-bigquery/issues/305)) ([6315842](https://www.github.com/googleapis/java-bigquery/commit/6315842dfa62a433a1ba507b861cf96a3d7cb03d)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20200415-1.30.9 ([#307](https://www.github.com/googleapis/java-bigquery/issues/307)) ([fccb0b4](https://www.github.com/googleapis/java-bigquery/commit/fccb0b4d08b41e4836ac9490befca47306f14afd)) +* update dependency com.google.auto.value:auto-value to v1.7.1 ([#308](https://www.github.com/googleapis/java-bigquery/issues/308)) ([5a0ed06](https://www.github.com/googleapis/java-bigquery/commit/5a0ed060eb2c966092af66bfae2896ea8af70c7e)) + ### [1.111.2](https://www.github.com/googleapis/java-bigquery/compare/v1.111.1...v1.111.2) (2020-04-29) diff --git a/README.md b/README.md index d71201d05a..9bdb28ee0e 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.111.1' +compile 'com.google.cloud:google-cloud-bigquery:1.111.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.111.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.111.3" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2ea14406a0..6d21659a50 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.111.3-SNAPSHOT + 1.111.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.111.3-SNAPSHOT + 1.111.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f30489d2b2..e66a9560ef 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.111.3-SNAPSHOT + 1.111.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -116,7 +116,7 @@ com.google.cloud google-cloud-bigquery - 1.111.3-SNAPSHOT + 1.111.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4c7ef45fca..13224ffde2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.111.3-SNAPSHOT + 1.111.3 diff --git a/versions.txt b/versions.txt index 23122fd509..6a4068d7fe 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.111.2:1.111.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.111.3:1.111.3 \ No newline at end of file