Skip to content

Commit 32551b2

Browse files
authored
bigquery: deprecate ambiguous usage of delete in BigQuery client. (#5052)
Now that datasets may contain resources other than just tables, deleting a resource using only the string identifiers without type information is ambiguous.
1 parent 00380da commit 32551b2

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

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

google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -673,22 +673,13 @@ public int hashCode() {
673673
/**
674674
* Deletes the requested table.
675675
*
676-
* <p>Example of deleting a table.
677-
*
678-
* <pre>{@code
679-
* String datasetName = "my_dataset_name";
680-
* String tableName = "my_table_name";
681-
* boolean deleted = bigquery.delete(datasetName, tableName);
682-
* if (deleted) {
683-
* // the table was deleted
684-
* } else {
685-
* // the table was not found
686-
* }
687-
* }</pre>
688-
*
676+
* @deprecated Now that BigQuery datasets contain multiple resource types, this invocation is
677+
* ambiguous. Please use more strongly typed version of {@code #delete} that leverages an
678+
* non-ambiguous resource type identifier such as {@code TableId}.
689679
* @return {@code true} if table was deleted, {@code false} if it was not found
690680
* @throws BigQueryException upon failure
691681
*/
682+
@Deprecated
692683
boolean delete(String datasetId, String tableId);
693684

694685
/**

0 commit comments

Comments
 (0)