Skip to content

Commit

Permalink
chore: rename DeleteIndexesAsync to DeleteIndexAsync (#513)
Browse files Browse the repository at this point in the history
Remove incorrect plural from DeleteIndexesAsync. The preview vector
index client has an unstable api warning, so this name change is
possible.
  • Loading branch information
nand4011 authored Nov 8, 2023
1 parent 304aa0d commit 0885ab2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
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);
}
}
}

0 comments on commit 0885ab2

Please sign in to comment.