GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Add labels to converter for listTables method (#3735) by tloszabno · Pull Request #3736 · googleapis/java-bigquery

This repository was archived by the owner on Aug 30, 2026. It is now read-only.

fix: Add labels to converter for listTables method (#3735) #3736

Merged
PhongChuong merged 1 commit into googleapis:main from tloszabno:bug-3735
Mar 25, 2025

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix: Add labels to converter for listTables method (#3735) #3736

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
31b85dd
fix: Add labels to converter for listTables method (#3735)
tloszabno Mar 24, 2025
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

3 changes: 2 additions & 1 deletion 3 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ public Table apply(TableList.Tables tablePb) {
.setCreationTime(tablePb.getCreationTime())
.setTimePartitioning(tablePb.getTimePartitioning())
.setRangePartitioning(tablePb.getRangePartitioning())
.setClustering(tablePb.getClustering());
.setClustering(tablePb.getClustering())
.setLabels(tablePb.getLabels());
}
}));
}
Expand Down
20 changes: 20 additions & 0 deletions 20 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class BigQueryImplTest {
.setField("timestampField");
private static final TimePartitioning TIME_PARTITIONING_NULL_TYPE =
TimePartitioning.fromPb(PB_TIMEPARTITIONING);
private static final ImmutableMap<String, String> LABELS = ImmutableMap.of("key", "value");
private static final StandardTableDefinition TABLE_DEFINITION_WITH_PARTITIONING =
StandardTableDefinition.newBuilder()
.setSchema(TABLE_SCHEMA)
Expand All @@ -155,6 +156,8 @@ public class BigQueryImplTest {
TableInfo.of(TABLE_ID, TABLE_DEFINITION_WITH_RANGE_PARTITIONING);
private static final TableInfo TABLE_INFO = TableInfo.of(TABLE_ID, TABLE_DEFINITION);
private static final TableInfo OTHER_TABLE_INFO = TableInfo.of(OTHER_TABLE_ID, TABLE_DEFINITION);
private static final TableInfo OTHER_TABLE_WITH_LABELS_INFO =
TableInfo.newBuilder(OTHER_TABLE_ID, TABLE_DEFINITION).setLabels(LABELS).build();
private static final TableInfo TABLE_INFO_WITH_PROJECT =
TableInfo.of(TABLE_ID_WITH_PROJECT, TABLE_DEFINITION);
private static final TableInfo MODEL_TABLE_INFO_WITH_PROJECT =
Expand Down Expand Up @@ -1151,6 +1154,23 @@ public void testListTablesFromDatasetIdWithProject() throws IOException {
.listTablesSkipExceptionTranslation(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS);
}

@Test
public void testListTablesWithLabels() throws IOException {
bigquery = options.getService();
ImmutableList<Table> tableList =
ImmutableList.of(
new Table(bigquery, new TableInfo.BuilderImpl(OTHER_TABLE_WITH_LABELS_INFO)));
Tuple<String, Iterable<com.google.api.services.bigquery.model.Table>> result =
Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION));
when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS))
.thenReturn(result);
Page<Table> page = bigquery.listTables(DATASET);
assertEquals(CURSOR, page.getNextPageToken());
assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class));
verify(bigqueryRpcMock).listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS);
assertEquals(LABELS, page.getValues().iterator().next().getLabels());
}

@Test
public void testListTablesWithOptions() throws IOException {
bigquery = options.getService();
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.