Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database.ReadAsync page could be clearer about how the DatabaseResponse returned is implicitly converted to a DatabaseProperties object #30503

Closed
OneEyedSi opened this issue Aug 14, 2022 · 4 comments · Fixed by Azure/azure-cosmos-dotnet-v3#3457
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@OneEyedSi
Copy link

The Database.ReadAsync Docs page appears contradictory and confusing. The summary states:

Reads a DatabaseProperties from the Azure Cosmos service as an asynchronous operation.

However, the definition shows the ReadAsync method returning a DatabaseResponse object, not a DatabaseProperties object:

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.DatabaseResponse> ReadAsync(...)

And the example on the page also shows ReadAsync returning a DatabaseResponse object:

DatabaseResponse response = await database.ReadAsync();

After some digging into Docs pages for DatabaseResponse and Response I can see there is an implicit operator that converts from DatabaseResponse to DatabaseProperties, which explains the apparent contradiction in the ReadAsync Docs page.

I think it would be useful to add a note to the ReadAsync page explaining this implicit conversion from DatabaseResponse to DatabaseProperties, or to modify the example to something like:

// ReadAsync returns a DatabaseResponse object.  However, there is an implicit conversion from 
// DatabaseResponse to DatabaseProperties.
DatabaseProperties properties = await database.ReadAsync();

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 14, 2022
@azure-sdk
Copy link
Collaborator

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Cosmos:0.19162846,Tables:0.16795743,SQL:0.08371939'

@jsquire jsquire added Cosmos Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team CXP Attention labels Aug 14, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 14, 2022
@ghost
Copy link

ghost commented Aug 14, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@SaurabhSharma-MSFT SaurabhSharma-MSFT self-assigned this Aug 15, 2022
@SaurabhSharma-MSFT
Copy link
Member

@AnotherSadGit We are looking into it and get back to you for any additional information.

@SaurabhSharma-MSFT
Copy link
Member

@AnotherSadGit The PR for the fix has been created and it will be merged soon. Thanks again for pointing this out, I am closing the issue based on this update, please let us know if there is something else that we can help you with.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants