Skip to content

.Net: [MEVD] API review changes to collection creation #11829

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

Closed
roji opened this issue May 1, 2025 · 0 comments
Closed

.Net: [MEVD] API review changes to collection creation #11829

roji opened this issue May 1, 2025 · 0 comments
Assignees
Labels
Build Features planned for next Build conference msft.ext.vectordata Related to Microsoft.Extensions.VectorData .NET Issue or Pull requests regarding .NET code

Comments

@roji
Copy link
Member

roji commented May 1, 2025

From API review:

  • Rename IVectorStore.CreateCollectionIfNotExistsAsync to EnsureCollectionExistsAsync.
  • Remove CreateCollectionAsync; we're not aware of non-contrived mainstream scenarios where users would actually need an exception to be thrown if the collection already exists.
  • Ensure that EnsureCollectionExistsAsync implementations are thread-safe.
    • This also covers calling EnsureCollectionExistsAsync from two separate .NET applications concurrently; in other words, an implementation that checks for existence and then calls a throwing CreateCollection isn't good, as that can fail.
    • Where a native idempotent database implementation doesn't exist, we can call a throwing CreateCollection and then recognize and ignore the "collection already exists" error.
@roji roji added .NET Issue or Pull requests regarding .NET code Build Features planned for next Build conference msft.ext.vectordata Related to Microsoft.Extensions.VectorData labels May 1, 2025
@github-actions github-actions bot changed the title [MEVD] API review changes to collection creation .Net: [MEVD] API review changes to collection creation May 1, 2025
@roji roji moved this to Backlog: Planned in Semantic Kernel May 1, 2025
@westey-m westey-m moved this from Backlog: Planned to Sprint: Planned in Semantic Kernel May 7, 2025
@westey-m westey-m moved this from Sprint: Planned to Sprint: In Progress in Semantic Kernel May 7, 2025
@westey-m westey-m moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernel May 7, 2025
westey-m added a commit that referenced this issue May 7, 2025
…reExists thread safe. (#11937)

### Motivation and Context

#11829

### Description

- DeleteCreateCollection
- Rename CreateCollectionIfNotExists to EnsureCollectionExists
- Make EnsureCollectionExists thread safe
- Update tests and samples.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@westey-m westey-m moved this from Sprint: In Review to Sprint: Done in Semantic Kernel May 8, 2025
@westey-m westey-m closed this as completed May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Features planned for next Build conference msft.ext.vectordata Related to Microsoft.Extensions.VectorData .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: Done
Development

No branches or pull requests

3 participants