azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

CreateTableIfNotExists documentation ambiguous and example is WRONG

Open CaymanTurtleBeach opened this issue 1 year ago • 3 comments

Type of issue

Other (describe below)

Description

CreateTableIfNotExists(tableName) should return a TableClient if table already exist, though documentation here is ambiguous in the case when a table exists.

Other documentation (azure-sdk-for-java/sdk/tables /azure-data-tables/ IS explicit: Create a table

Create a table by calling the TableServiceClient's createTable method. A TableClient will be returned, this client allows performing operations on the table. An exception will be thrown if a table with the provided name exists.

TableClient tableClient = tableServiceClient.createTable(tableName);

Alternatively, you can call the createTableIfNotExists method which will create the table only if no such table exists, and does not throw an exception. A TableClient will be returned as well.

TableClient tableClient = tableServiceClient.createTableIfNotExists(tableName);

And that behavior is consistent with supposedly obsolete Storage 8.6.6.

BUT "new" Library returns null if table already exists.

What good is it to RTFM when TFM is WRONG.

Page URL

https://learn.microsoft.com/en-us/java/api/com.azure.data.tables.tableserviceclient?view=azure-java-stable#com-azure-data-tables-tableserviceclient-listtables()

Content source URL

https://github.com/Azure/azure-docs-sdk-java/blob/master/docs-ref-autogen/com.azure.data.tables.TableServiceClient.yml

Document Version Independent Id

7caaef32-5972-32f7-f72a-cc025b389068

Article author

@rloutlaw

Metadata

  • ID: 1571c383-fd77-a979-2e40-8554fcc7f6ae

CaymanTurtleBeach avatar Apr 28 '24 23:04 CaymanTurtleBeach

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] avatar Apr 28 '24 23:04 github-actions[bot]

@CaymanTurtleBeach Thank you for reaching out. I will look into your issue and respond shortly.

jairmyree avatar Apr 29 '24 17:04 jairmyree

@CaymanTurtleBeach Thank you for your issue.

I will update the documentation for createTableIfNotExists to include the expected outcome in the case where the Table already exists. Additionally, I will also address the improper return value.

jairmyree avatar Apr 29 '24 17:04 jairmyree