Skip to content

Commit

Permalink
chore: Remove ensure short flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed Mar 10, 2024
1 parent 5a60f7b commit b7c28f4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cmd/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func init() {
ListCollectionsCommand.Flags().StringP("alias", "s", "", "Server alias name. If not provided, the active server will be used.")
CreateCollectionCommand.Flags().String("name", "", "Name of the collection")
CreateCollectionCommand.Flags().StringP("alias", "s", "", "Server alias name. If not provided, the active server will be used.")
CreateCollectionCommand.Flags().BoolP("ensure", "x", false, "Create collection only if it doesn't exist. Chroma will be queried before sending create, if the collection exists, exit with 0. The metadata will be overwritten.")
CreateCollectionCommand.Flags().Bool("ensure", false, "Create collection only if it doesn't exist. Chroma will be queried before sending create, if the collection exists, exit with 0. The metadata will be overwritten.")
CreateCollectionCommand.Flags().StringP("space", "p", string(types.L2), "Distance metric to use for the collection")
CreateCollectionCommand.Flags().IntP("m", "m", 16, "hnsw:m - The maximum number of outgoing connections (links) for a single node within the HNSW graph.")
CreateCollectionCommand.Flags().IntP("construction-ef", "u", 100, "hnsw:construction_ef - This parameter influences the size of the dynamic list used during the graph construction phase.")
Expand Down
20 changes: 0 additions & 20 deletions cmd/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,6 @@ func TestCreateCollectionCommand(t *testing.T) {
require.Equal(t, expectedOutput, output)
})

t.Run("Create Collection with Ensure flag short", func(t *testing.T) {
client := setup()
defer tearDown(client)
var collectionName = "my-new-collection"
expectedOutput := fmt.Sprintf("Collection created: %v\n", collectionName)
buf := new(bytes.Buffer)
command.SetOut(buf)
command.SetErr(buf)
command.SetArgs([]string{"create", collectionName, "-x"})
c, err := command.ExecuteC()
require.NoError(t, err)
output := buf.String()
require.Equal(t, expectedOutput, output)
buf.Reset()
_, err = c.ExecuteC() // we execute the same command again, result is idempotent
require.NoError(t, err)
assertCollectionExists(t, client, collectionName)
require.Equal(t, expectedOutput, output)
})

t.Run("Create Collection with M flag long", func(t *testing.T) {
client := setup()
defer tearDown(client)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ chroma create <collection-name> \
-k/--sync-threshold <hnsw:sync_threshold> \
-n/--threads <hnsw:threads> \
-r/--resize-factor <hnsw:resize_factor> \
-e/--ensure <create_if_not_exist>
--ensure <create_if_not_exist>
```

### Clone Collection
Expand Down

0 comments on commit b7c28f4

Please sign in to comment.