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

chore: rename DeleteIndexesAsync to DeleteIndexAsync #513

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Momento.Sdk/IPreviewVectorIndexClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public interface IPreviewVectorIndexClient : IDisposable
/// }
/// </code>
///</returns>
public Task<DeleteIndexResponse> DeleteIndexesAsync(string indexName);
public Task<DeleteIndexResponse> DeleteIndexAsync(string indexName);

/// <summary>
/// Upserts a batch of items into a vector index.
Expand Down
2 changes: 1 addition & 1 deletion src/Momento.Sdk/PreviewVectorIndexClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<ListIndexesResponse> ListIndexesAsync()
}

/// <inheritdoc />
public async Task<DeleteIndexResponse> DeleteIndexesAsync(string indexName)
public async Task<DeleteIndexResponse> DeleteIndexAsync(string indexName)
{
return await controlClient.DeleteIndexAsync(indexName);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Momento.Sdk.Tests/VectorIndexControlTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task CreateListDelete_HappyPath()
}
finally
{
var deleteResponse = await vectorIndexClient.DeleteIndexesAsync(indexName);
var deleteResponse = await vectorIndexClient.DeleteIndexAsync(indexName);
Assert.True(deleteResponse is DeleteIndexResponse.Success, $"Unexpected response: {deleteResponse}");
}
}
Expand Down Expand Up @@ -75,7 +75,7 @@ public async Task CreateIndexAsync_InvalidNumDimensions()
public async Task DeleteIndexAsync_DoesntExistError()
{
var indexName = $"index-{Utils.NewGuidString()}";
var deleteResponse = await vectorIndexClient.DeleteIndexesAsync(indexName);
var deleteResponse = await vectorIndexClient.DeleteIndexAsync(indexName);
Assert.True(deleteResponse is DeleteIndexResponse.Error, $"Unexpected response: {deleteResponse}");
var deleteErr = (DeleteIndexResponse.Error)deleteResponse;
Assert.Equal(MomentoErrorCode.NOT_FOUND_ERROR, deleteErr.InnerException.ErrorCode);
Expand Down
25 changes: 6 additions & 19 deletions tests/Integration/Momento.Sdk.Tests/VectorIndexDataTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public async Task UpsertAndSearch_InnerProduct()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}

Expand Down Expand Up @@ -123,7 +123,7 @@ public async Task UpsertAndSearch_CosineSimilarity()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}

Expand Down Expand Up @@ -161,7 +161,7 @@ public async Task UpsertAndSearch_EuclideanSimilarity()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}

Expand Down Expand Up @@ -197,7 +197,7 @@ public async Task UpsertAndSearch_TopKLimit()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}

Expand Down Expand Up @@ -271,7 +271,7 @@ public async Task UpsertAndSearch_WithMetadata()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}

Expand Down Expand Up @@ -314,20 +314,7 @@ public async Task UpsertAndSearch_WithDiverseMetadata()
}
finally
{
await vectorIndexClient.DeleteIndexesAsync(indexName);
}
}

[Fact]
public async Task TempDeleteAllIndexes()
{
var listResponse = await vectorIndexClient.ListIndexesAsync();
Assert.True(listResponse is ListIndexesResponse.Success, $"Unexpected response: {listResponse}");
var listOk = (ListIndexesResponse.Success)listResponse;
foreach (var indexName in listOk.IndexNames)
{
var deleteResponse = await vectorIndexClient.DeleteIndexesAsync(indexName);
Assert.True(deleteResponse is DeleteIndexResponse.Success, $"Unexpected response: {deleteResponse}");
await vectorIndexClient.DeleteIndexAsync(indexName);
}
}
}
Loading