Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 3e7ba7f

Browse files
author
Praful Makani
authored
docs(samples): fix checkstyle errors (#297)
1 parent e124018 commit 3e7ba7f

File tree

5 files changed

+25
-30
lines changed

5 files changed

+25
-30
lines changed

samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.google.cloud.bigquery.datatransfer.v1.TransferConfig;
2525
import com.google.protobuf.Struct;
2626
import com.google.protobuf.Value;
27-
2827
import java.io.IOException;
2928
import java.util.HashMap;
3029
import java.util.Map;
@@ -34,10 +33,11 @@ public class CreateScheduledQuery {
3433

3534
public static void runCreateScheduledQuery() {
3635
// TODO(developer): Replace these variables before running the sample.
37-
String projectId = "MY_PROJECT_ID";
38-
String datasetId = "MY_DATASET_ID";
39-
String query =
40-
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer";
36+
final String projectId = "MY_PROJECT_ID";
37+
final String datasetId = "MY_DATASET_ID";
38+
final String query =
39+
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, "
40+
+ "@run_date as intended_run_date, 17 as some_integer";
4141
Map<String, Value> params = new HashMap<>();
4242
params.put("query", Value.newBuilder().setStringValue(query).build());
4343
params.put(

samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.google.api.gax.rpc.ApiException;
2121
import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient;
2222
import com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest;
23-
2423
import java.io.IOException;
2524

2625
// Sample to delete a scheduled query

samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
import com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest;
2626

2727
public class QuickstartSample {
28-
/**
29-
* List available data sources for the BigQuery Data Transfer service.
30-
*/
28+
/** List available data sources for the BigQuery Data Transfer service. */
3129
public static void main(String... args) throws Exception {
3230
// Sets your Google Cloud Platform project ID.
3331
// String projectId = "YOUR_PROJECT_ID";
@@ -40,9 +38,7 @@ public static void main(String... args) throws Exception {
4038
// Request the list of available data sources.
4139
String parent = String.format("projects/%s", projectId);
4240
ListDataSourcesRequest request =
43-
ListDataSourcesRequest.newBuilder()
44-
.setParent(parent)
45-
.build();
41+
ListDataSourcesRequest.newBuilder().setParent(parent).build();
4642
ListDataSourcesPagedResponse response = client.listDataSources(request);
4743

4844
// Print the results.

samples/snippets/src/test/java/com/example/bigquerydatatransfer/CreateScheduledQueryIT.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,25 @@
1616

1717
package com.example.bigquerydatatransfer;
1818

19+
import static com.google.common.truth.Truth.assertThat;
20+
import static junit.framework.TestCase.assertNotNull;
21+
1922
import com.google.cloud.bigquery.BigQuery;
2023
import com.google.cloud.bigquery.BigQueryOptions;
2124
import com.google.cloud.bigquery.DatasetInfo;
2225
import com.google.cloud.bigquery.datatransfer.v1.TransferConfig;
2326
import com.google.cloud.bigquery.datatransfer.v1.TransferState;
2427
import com.google.protobuf.Struct;
2528
import com.google.protobuf.Value;
26-
import org.junit.After;
27-
import org.junit.Before;
28-
import org.junit.BeforeClass;
29-
import org.junit.Test;
30-
3129
import java.io.ByteArrayOutputStream;
3230
import java.io.PrintStream;
3331
import java.util.HashMap;
3432
import java.util.Map;
3533
import java.util.UUID;
36-
37-
import static com.google.common.truth.Truth.assertThat;
38-
import static junit.framework.TestCase.assertNotNull;
34+
import org.junit.After;
35+
import org.junit.Before;
36+
import org.junit.BeforeClass;
37+
import org.junit.Test;
3938

4039
public class CreateScheduledQueryIT {
4140

@@ -85,7 +84,8 @@ public void tearDown() {
8584
@Test
8685
public void testCreateScheduledQuery() {
8786
String query =
88-
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer";
87+
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, "
88+
+ "@run_date as intended_run_date, 17 as some_integer";
8989
String destinationTableName =
9090
"MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}";
9191
Map<String, Value> params = new HashMap<>();

samples/snippets/src/test/java/com/example/bigquerydatatransfer/DeleteScheduledQueryIT.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,24 @@
1616

1717
package com.example.bigquerydatatransfer;
1818

19+
import static com.google.common.truth.Truth.assertThat;
20+
import static junit.framework.TestCase.assertNotNull;
21+
1922
import com.google.cloud.bigquery.BigQuery;
2023
import com.google.cloud.bigquery.BigQueryOptions;
2124
import com.google.cloud.bigquery.DatasetInfo;
2225
import com.google.cloud.bigquery.datatransfer.v1.TransferConfig;
2326
import com.google.protobuf.Struct;
2427
import com.google.protobuf.Value;
25-
import org.junit.After;
26-
import org.junit.Before;
27-
import org.junit.BeforeClass;
28-
import org.junit.Test;
29-
3028
import java.io.ByteArrayOutputStream;
3129
import java.io.PrintStream;
3230
import java.util.HashMap;
3331
import java.util.Map;
3432
import java.util.UUID;
35-
36-
import static com.google.common.truth.Truth.assertThat;
37-
import static junit.framework.TestCase.assertNotNull;
33+
import org.junit.After;
34+
import org.junit.Before;
35+
import org.junit.BeforeClass;
36+
import org.junit.Test;
3837

3938
public class DeleteScheduledQueryIT {
4039

@@ -74,7 +73,8 @@ public void setUp() {
7473

7574
// create a scheduled query
7675
String query =
77-
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer";
76+
"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, "
77+
+ "@run_date as intended_run_date, 17 as some_integer";
7878
String destinationTableName =
7979
"MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}";
8080
Map<String, Value> params = new HashMap<>();

0 commit comments

Comments
 (0)