Skip to content

Commit

Permalink
fix - BQ TableResult is now abstract, constructed via builder
Browse files Browse the repository at this point in the history
  • Loading branch information
okotsopoulos committed Aug 7, 2024
1 parent b0fbbf3 commit 654f178
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/test/java/bio/terra/common/BQTestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ public static void mockBQQuery(

private static Answer<TableResult> mockAnswer(Schema schema, List<Map<String, String>> results) {
return a ->
new TableResult(
schema, results.size(), new PageImpl<>(null, null, convertValues(results, schema)));
TableResult.newBuilder()
.setSchema(schema)
.setTotalRows((long) results.size())
.setPageNoSchema(new PageImpl<>(null, null, convertValues(results, schema)))
.build();
}

private static List<FieldValueList> convertValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,8 @@ void aggregateSnapshotTableTest() {

Page<FieldValueList> page = mockPage(listOfFieldValueList);

TableResult table = new TableResult(schema, 10, page);
TableResult table =
TableResult.newBuilder().setSchema(schema).setTotalRows(10L).setPageNoSchema(page).build();

List<BigQueryDataResultModel> result = BigQueryPdao.aggregateTableData(table);

Expand Down Expand Up @@ -1091,7 +1092,8 @@ void testAggregateTextColumnStats() {
"2"))))); // For some reason, it wants the numeric value passed in as a
// string

TableResult table = new TableResult(schema, 10, page);
TableResult table =
TableResult.newBuilder().setSchema(schema).setTotalRows(10L).setPageNoSchema(page).build();

List<ColumnStatisticsTextValue> result =
BigQueryPdao.aggregateTextColumnStats(table, columnName);
Expand Down

0 comments on commit 654f178

Please sign in to comment.