Skip to content

Commit

Permalink
fix: hide TableReference data struct (#2855)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 5, 2023
1 parent 814f393 commit 2cbded6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ __pycache__
.new-list.txt
.org-list.txt
SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java
.flattened-pom.xml
.flattened-pom.xml
# Local Test files
*ITLocalTest.java
10 changes: 10 additions & 0 deletions google-cloud-bigquery/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,14 @@
<className>com/google/cloud/bigquery/TableInfo*</className>
<method>*TableConstraints(*)</method>
</difference>
<difference>
<differenceType>7013</differenceType>
<className>com/google/cloud/bigquery/IndexUnusedReason*</className>
<method>*BaseTableId(*)</method>
</difference>
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigquery/IndexUnusedReason*</className>
<method>*BaseTable(*)</method>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 =
Expand All @@ -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;
}
Expand All @@ -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();
}
Expand Down

0 comments on commit 2cbded6

Please sign in to comment.