From 2cbded6600af1de8ec15b04a2496733ad2b50c47 Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Tue, 5 Sep 2023 11:12:14 -0400 Subject: [PATCH] fix: hide TableReference data struct (#2855) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: hide TableReference data struct * chore: add clirr ignored differences * chore: organize imports * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Neenu1995 Co-authored-by: Owl Bot --- .gitignore | 4 +++- google-cloud-bigquery/clirr-ignored-differences.xml | 10 ++++++++++ .../google/cloud/bigquery/IndexUnusedReason.java | 13 ++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 1c7a7e78f..c94c87d10 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ __pycache__ .new-list.txt .org-list.txt SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java -.flattened-pom.xml \ No newline at end of file +.flattened-pom.xml +# Local Test files +*ITLocalTest.java \ No newline at end of file diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 500ce3f58..41067bd21 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -94,4 +94,14 @@ com/google/cloud/bigquery/TableInfo* *TableConstraints(*) + + 7013 + com/google/cloud/bigquery/IndexUnusedReason* + *BaseTableId(*) + + + 7002 + com/google/cloud/bigquery/IndexUnusedReason* + *BaseTable(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java index 06a88b068..bb4f0c3c3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java @@ -16,7 +16,6 @@ package com.google.cloud.bigquery; -import com.google.api.services.bigquery.model.TableReference; import com.google.auto.value.AutoValue; import java.io.Serializable; import javax.annotation.Nullable; @@ -52,9 +51,9 @@ public abstract static class Builder { /** * Specifies the base table involved in the reason that no search index was used. * - * @param tableReference tableReference or {@code null} for none + * @param baseTable baseTable or {@code null} for none */ - public abstract Builder setBaseTable(TableReference tableReference); + public abstract Builder setBaseTableId(TableId baseTable); /** Creates a @code IndexUnusedReason} object. */ public abstract IndexUnusedReason build(); @@ -96,7 +95,7 @@ public static Builder newBuilder() { * @return value or {@code null} for none */ @Nullable - public abstract TableReference getBaseTable(); + public abstract TableId getBaseTableId(); com.google.api.services.bigquery.model.IndexUnusedReason toPb() { com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason = @@ -110,8 +109,8 @@ com.google.api.services.bigquery.model.IndexUnusedReason toPb() { if (getMessage() != null) { indexUnusedReason.setMessage(indexUnusedReason.getMessage()); } - if (getBaseTable() != null) { - indexUnusedReason.setBaseTable(indexUnusedReason.getBaseTable()); + if (getBaseTableId() != null) { + indexUnusedReason.setBaseTable(getBaseTableId().toPb()); } return indexUnusedReason; } @@ -129,7 +128,7 @@ static IndexUnusedReason fromPb( builder.setMessage(indexUnusedReason.getMessage()); } if (indexUnusedReason.getBaseTable() != null) { - builder.setBaseTable(indexUnusedReason.getBaseTable()); + builder.setBaseTableId(TableId.fromPb(indexUnusedReason.getBaseTable())); } return builder.build(); }