Skip to content

Commit 1654bb0

Browse files
Fix --file/--body aliasing in pc vector upsert (#64)
## 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

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 changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.cache/go-build/03/03c99cf2b4cd5c80176d48862ac8e778a66fb2f5ba5c2f9deb920f8339c6b596-a

Lines changed: 0 additions & 1 deletion
This file was deleted.

.cache/go-build/04/04fde55a95d92032e8b20874c1348de00366cb27e8e7bb8cc38842f45c28c994-a

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.

.cache/go-build/05/05c56dbf57aff1b128aa2c6bc9bf6505a8e0983ba390158bfad8f76e886f2e66-a

Lines changed: 0 additions & 1 deletion
This file was deleted.

.cache/go-build/05/05f2bbd1a4560ddb99260e95cdf779524f451295bfb1f55c8e44d9a8a5bcd60d-a

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)