feat: Relax client-side validation for BigQuery entity IDs (#4000) · googleapis/java-bigquery@c3548a2

File tree

5 files changed

lines changed

  • google-cloud-bigquery/src/main/java/com/google/cloud/bigquery

5 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -16,8 +16,6 @@

1616
1717

package com.google.cloud.bigquery;

1818
19-

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

20-
2119

import com.google.common.base.Function;

2220

import com.google.common.base.MoreObjects;

2321

import com.google.common.base.Objects;

@@ -82,8 +80,8 @@ public ConnectionProperty build() {

8280

}

8381
8482

private ConnectionProperty(Builder builder) {

85-

this.key = checkNotNull(builder.key, "Required key is null or empty");

86-

this.value = checkNotNull(builder.value, "Required value is null or empty");

83+

this.key = builder.key;

84+

this.value = builder.value;

8785

}

8886
8987

/** Return the key of property. */

Original file line numberDiff line numberDiff line change

@@ -16,9 +16,6 @@

1616
1717

package com.google.cloud.bigquery;

1818
19-

import static com.google.common.base.Preconditions.checkArgument;

20-

import static com.google.common.base.Strings.isNullOrEmpty;

21-
2219

import com.google.api.services.bigquery.model.DatasetReference;

2320

import io.opentelemetry.api.common.Attributes;

2421

import java.io.Serializable;

@@ -43,7 +40,6 @@ public String getDataset() {

4340

}

4441
4542

private DatasetId(String project, String dataset) {

46-

checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty");

4743

this.project = project;

4844

this.dataset = dataset;

4945

}

Original file line numberDiff line numberDiff line change

@@ -62,8 +62,6 @@ public String getModel() {

6262

}

6363
6464

private ModelId(String project, String dataset, String model) {

65-

checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty");

66-

checkArgument(!isNullOrEmpty(model), "Provided model is null or empty");

6765

this.project = project;

6866

this.dataset = dataset;

6967

this.model = model;

Original file line numberDiff line numberDiff line change

@@ -63,8 +63,6 @@ public String getRoutine() {

6363

}

6464
6565

private RoutineId(String project, String dataset, String routine) {

66-

checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty");

67-

checkArgument(!isNullOrEmpty(routine), "Provided routine is null or empty");

6866

this.project = project;

6967

this.dataset = dataset;

7068

this.routine = routine;

Original file line numberDiff line numberDiff line change

@@ -71,8 +71,6 @@ public String getIAMResourceName() {

7171

}

7272
7373

private TableId(String project, String dataset, String table) {

74-

checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty");

75-

checkArgument(!isNullOrEmpty(table), "Provided table is null or empty");

7674

this.project = project;

7775

this.dataset = dataset;

7876

this.table = table;