Skip to content

Commit 059da48

Browse files
dfirovagcf-owl-bot[bot]Sita04
authored
fix(samples): bug fix for removing buckets from bq. (#548)
* Removed env variables and buckets from creating BQ. * Fix: removed buckets from BQ import * pr fix: imports. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * pr fix: fixed test. * pr fix: added comment. * fix(samples): bug fix for removing buckets from bq. * pr fix: moved commented lines * pr fix: added dot to importproductsbigquerytable. Co-authored-by: Sita Lakshmi Sangameswaran <[email protected]> * pr fix: added dot in importproductsbigquerytable Co-authored-by: Sita Lakshmi Sangameswaran <[email protected]> * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Sita Lakshmi Sangameswaran <[email protected]>
1 parent b9ba700 commit 059da48

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

java-retail/samples/interactive-tutorials/src/main/java/product/ImportProductsBigQueryTable.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ public class ImportProductsBigQueryTable {
3737

3838
public static void main(String[] args) throws IOException, InterruptedException {
3939
String projectId = ServiceOptions.getDefaultProjectId();
40+
// To check for error handling, replace the below variable with the invalid branch name.
41+
// String branchName = "invalid_branch_name";
4042
String branchName =
4143
String.format(
4244
"projects/%s/locations/global/catalogs/default_catalog/branches/0", projectId);
4345
String datasetId = "products";
46+
// To check for error handling, replace the below variable with table id that contains invalid
47+
// products.
48+
// String tableId = "products_some_invalid";
4449
String tableId = "products";
45-
// TO CHECK ERROR HANDLING USE THE TABLE WITH INVALID PRODUCTS:
46-
// tableId = "products_some_invalid"
4750

4851
importProductsFromBigQuery(projectId, branchName, datasetId, tableId);
4952
}

java-retail/samples/interactive-tutorials/src/main/java/product/setup/ProductsCreateBigqueryTable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void main(String[] args) throws IOException {
3838
String validProductsSourceFile =
3939
ProductsCreateBigqueryTable.class.getResource("/products.json").getPath();
4040
String invalidProductsSourceFile =
41-
ProductsCreateBigqueryTable.class.getResource("products_some_invalid.json").getPath();
41+
ProductsCreateBigqueryTable.class.getResource("/products_some_invalid.json").getPath();
4242

4343
BufferedReader bufferedReader = new BufferedReader(new FileReader(productSchemaFilePath));
4444
String jsonToString = bufferedReader.lines().collect(Collectors.joining());

0 commit comments

Comments
 (0)