Commit 1654bb0
authored
## Problem
@bradumbaugh reported an issue with the aliasing in the `pc vector
upsert` command. `--file` and `--body` flags are meant to be aliases,
but `--file` is configured as required making `--body` unusable due to
cobra error'ing when `--file` is not passed.
## Solution
Make sure --file is not configured as a required flag to vector upsert
since --body is an alias, add custom validation / error handling for the
empty file/body case.
Additionally, I cleaned up a `.cache` folder that was incorrectly
committed to source previously, along with removing the
claude-code-review workflows from the repo. We've been using cursorbot
generally, and I'll get this repo setup with that in a follow-up PR.
### Before
```
./dist/pc_darwin_arm64_v8.0/pc index vector upsert --index-name test-cps --body /Users/austin/workspace/go-pinecone-consumer/dense_dim_3_x4.json
Error: required flag(s) "file" not set
Usage:
pc index vector upsert [flags]
Examples:
$ pc index vector upsert --index-name my-index --namespace my-namespace --body ./vectors.json
$ pc index vector upsert --index-name my-index --namespace my-namespace --body ./vectors.jsonl
$ cat payload.json | pc index vector upsert --index-name my-index --namespace my-namespace --body -
Flags:
-b, --batch-size int size of batches to upsert (default: 500) (default 500)
--body string alias for --file
--file string request body JSON or JSONL (inline, ./path.json[l], or '-' for stdin; only one argument may use stdin)
-h, --help help for upsert
-n, --index-name string name of index to upsert into
-j, --json output as JSON
--namespace string namespace to upsert into (default "__default__")
Global Flags:
-q, --quiet suppress output
--timeout duration timeout for commands, defaults to 60s (0 to disable) (default 1m0s)
```
###After
```
./dist/pc_darwin_arm64_v8.0/pc index vector upsert --index-name test-cps --body /Users/austin/workspace/go-pinecone-consumer/dense_dim_3_x4.json
[SUCCESS] Upserted 4 vectors into namespace __default__ (batch 1 of 1)
```
## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [ ] Non-code change (docs, etc)
- [ ] None of the above: (explain here)
## Test Plan
Test corrected flow by calling `pc index vector upsert --index-name
my-index --body my-file.json` and observe no errors.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1213127763902388
1 parent 9a4ea15 commit 1654bb0
File tree
476 files changed
+7
-377
lines changed- .cache
- go-build
- 00
- 01
- 02
- 03
- 04
- 05
- 07
- 09
- 0d
- 0e
- 0f
- 11
- 12
- 13
- 16
- 17
- 18
- 19
- 1a
- 1b
- 1c
- 1e
- 1f
- 20
- 22
- 23
- 24
- 26
- 27
- 28
- 2a
- 2b
- 2c
- 2d
- 2e
- 2f
- 30
- 31
- 32
- 33
- 35
- 36
- 37
- 38
- 39
- 3a
- 3b
- 3c
- 3d
- 3e
- 40
- 41
- 42
- 43
- 44
- 45
- 47
- 48
- 4a
- 4c
- 4e
- 4f
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 58
- 59
- 5a
- 5b
- 5c
- 5d
- 5e
- 5f
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 6a
- 6b
- 6c
- 6d
- 6e
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 7c
- 7d
- 7f
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 8a
- 8b
- 8d
- 8e
- 8f
- 91
- 92
- 93
- 94
- 95
- 97
- 98
- 99
- 9a
- 9b
- 9c
- 9d
- 9e
- 9f
- a0
- a1
- a3
- a4
- a5
- a6
- a7
- a8
- a9
- aa
- ab
- ad
- ae
- af
- b0
- b1
- b2
- b3
- b4
- b5
- b9
- ba
- bb
- bc
- bd
- be
- c0
- c1
- c2
- c3
- c4
- c7
- c9
- ca
- cb
- cc
- cd
- ce
- cf
- d0
- d1
- d2
- d3
- d4
- d6
- d8
- da
- db
- dc
- dd
- df
- e0
- e1
- e3
- e4
- e5
- e6
- e7
- e8
- e9
- ea
- eb
- ec
- ed
- ee
- ef
- f0
- f2
- f3
- f4
- f5
- f6
- f8
- f9
- fa
- fb
- fc
- fd
- fe
- ff
- go-mod/cache/download
- github.com
- !make!now!just/heredoc/@v
- briandowns/spinner/@v
- charmbracelet
- bubbles/@v
- bubbletea/@v
- lipgloss/@v
- fatih/color/@v
- golang-jwt/jwt/v5/@v
- pinecone-io/go-pinecone/v5/@v
- rs/zerolog/@v
- spf13
- cobra/@v
- viper/@v
- stretchr/testify/@v
- golang.org/x
- oauth2/@v
- term/@v
- .github/workflows
- internal/pkg/cli/command/index/vector
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
476 files changed
+7
-377
lines changedBinary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
0 commit comments