Skip to content
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 internal/pkg/cli/command/index/record/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func NewSearchCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to search")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to search")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to search")
cmd.Flags().IntVarP(&options.topK, "top-k", "k", defaultSearchTopK, "number of results to return")
cmd.Flags().Var(&options.inputs, "inputs", "query inputs for search (inline JSON, ./path.json, or '-' for stdin); requires integrated embedding")
cmd.Flags().Var(&options.filter, "filter", "metadata filter (inline JSON, ./path.json, or '-' for stdin)")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/record/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewUpsertCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of index to upsert into")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to upsert into")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to upsert into")
cmd.Flags().StringVar(&options.file, "file", "", "request body JSON or JSONL (inline, ./path.json[l], or '-' for stdin; only one argument may use stdin)")
cmd.Flags().StringVar(&options.file, "body", "", "alias for --file")
cmd.Flags().IntVarP(&options.batchSize, "batch-size", "b", 96, "records per batch (max 96)")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewDeleteVectorsCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to delete vectors from")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to delete vectors from")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to delete vectors from")
cmd.Flags().Var(&options.ids, "ids", "IDs of the vectors to delete (inline JSON string array, ./path.json, or '-' for stdin)")
cmd.Flags().Var(&options.filter, "filter", "filter to delete the vectors with (inline JSON, ./path.json, or '-' for stdin)")
cmd.Flags().BoolVar(&options.deleteAllVectors, "all-vectors", false, "delete all vectors from the namespace")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewFetchCmd() *cobra.Command {
cmd.Flags().VarP(&options.ids, "ids", "i", "IDs of vectors to fetch (inline JSON string array, ./path.json, or '-' for stdin)")
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the fetch (inline JSON, ./path.json, or '-' for stdin)")
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to fetch from")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to fetch from")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to fetch from")
cmd.Flags().Uint32VarP(&options.limit, "limit", "l", 0, "maximum number of vectors to fetch")
cmd.Flags().StringVarP(&options.paginationToken, "pagination-token", "p", "", "pagination token to continue a previous listing operation")
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, ./path.json, or '-' for stdin; only one argument may use stdin)")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/list_vectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewListVectorsCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to list vectors from")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to list vectors from")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to list vectors from")
cmd.Flags().Uint32VarP(&options.limit, "limit", "l", 0, "maximum number of vectors to list")
cmd.Flags().StringVarP(&options.paginationToken, "pagination-token", "p", "", "pagination token to continue a previous listing operation")
cmd.Flags().BoolVarP(&options.json, "json", "j", false, "output as JSON")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewQueryCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to query")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "index namespace to query")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "index namespace to query")
cmd.Flags().Uint32VarP(&options.topK, "top-k", "k", 10, "maximum number of results to return")
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the query (inline JSON, ./path.json, or '-' for stdin)")
cmd.Flags().BoolVar(&options.includeValues, "include-values", false, "include vector values in the query results")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewUpdateCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to update")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to update the vector in")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to update the vector in")
cmd.Flags().StringVar(&options.id, "id", "", "ID of the vector to update")
cmd.Flags().Var(&options.values, "values", "values to update the vector with (inline JSON array, ./path.json, or '-' for stdin)")
cmd.Flags().Var(&options.sparseIndices, "sparse-indices", "sparse indices to update the vector with (inline JSON array, ./path.json, or '-' for stdin)")
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/command/index/vector/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewUpsertCmd() *cobra.Command {
}

cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of index to upsert into")
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to upsert into")
cmd.Flags().StringVar(&options.namespace, "namespace", "", "namespace to upsert into")
cmd.Flags().StringVar(&options.file, "file", "", "request body JSON or JSONL (inline, ./path.json[l], or '-' for stdin; only one argument may use stdin)")
cmd.Flags().StringVar(&options.file, "body", "", "alias for --file")
cmd.Flags().IntVarP(&options.batchSize, "batch-size", "b", 500, "size of batches to upsert (default: 500)")
Expand Down
6 changes: 5 additions & 1 deletion internal/pkg/utils/sdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ func NewIndexConnection(ctx context.Context, pc *pinecone.Client, indexName stri
if err != nil {
return nil, fmt.Errorf("failed to create index connection: %w", err)
}
return ic, nil
// The SDK coerces Namespace="" to "__default__" inside pc.Index. Re-apply
// the caller's value via WithNamespace so that an empty namespace is sent
// as "" on the wire (proto3 zero value) rather than the literal string
// "__default__", which requires an active server-side conversion.
return ic.WithNamespace(namespace), nil
}

func getCLIAPIKeyForProject(ctx context.Context, ac *pinecone.AdminClient, project *pinecone.Project) (string, error) {
Expand Down
Loading