Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pinecone): pinecone batch upsert #927

Merged
merged 11 commits into from
Dec 11, 2024

Conversation

chuang8511
Copy link
Contributor

@chuang8511 chuang8511 commented Dec 9, 2024

Because

  • we will need batch upsert

This commit

  • refactor task upsert with concurrent execution

Copy link

linear bot commented Dec 9, 2024

@chuang8511 chuang8511 marked this pull request as ready for review December 9, 2024 13:13
@chuang8511 chuang8511 marked this pull request as draft December 9, 2024 13:17
@chuang8511 chuang8511 marked this pull request as ready for review December 9, 2024 23:40
pkg/component/data/pinecone/v0/config/tasks.json Outdated Show resolved Hide resolved
pkg/component/data/pinecone/v0/structs.go Outdated Show resolved Hide resolved
pkg/component/data/pinecone/v0/io.go Show resolved Hide resolved
pkg/component/data/pinecone/v0/component_test.go Outdated Show resolved Hide resolved
pkg/component/data/pinecone/v0/component_test.go Outdated Show resolved Hide resolved
@jvallesm
Copy link
Collaborator

jvallesm commented Dec 10, 2024

QA

Recipe

variable:
  id:
    format: string
  colour:
    format: string
component:
  pinecone-0:
    type: pinecone
    task: TASK_BATCH_UPSERT
    input:
      vectors:
        - id: d
          values: [1.0, 2.0, 2.0]
          metadata:
            color: dusk
        - id: ${variable.id}
          values: [0.0, -1.0, 5.0]
          metadata:
            color: ${variable.colour}
      namespace: jazz
    condition:
    setup: ${connection.pinecone}
output:
  out:
    value: ${pinecone-0.output.upserted-count}

Request

$ curl -X POST 'http://localhost:8080/v1beta/users/jvallesm/pipelines/pineco/trigger' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $INSTILL_API_TOKEN" \
--data '{
  "inputs": [
    {
      "colour": "orchid",
      "id": "z"
    }
  ]
}' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   247  100   172  100    75     45     19  0:00:03  0:00:03 --:--:--    64
{
  "outputs": [
    {
      "out": 2
    }
  ],
  "metadata": {
    "traces": {
      "pinecone-0": {
        "statuses": [
          "STATUS_COMPLETED"
        ],
        "inputs": [],
        "outputs": [],
        "error": {
          "message": ""
        },
        "computeTimeInSeconds": 0
      }
    }
  }
}

Result

CleanShot 2024-12-10 at 19 58 36

Edit: re-tested with non-string metadata values

CleanShot 2024-12-11 at 10 18 25

@jvallesm jvallesm force-pushed the chunhao/ins-6919-pinecone-batch-upsert branch from 12d36fd to ef27531 Compare December 10, 2024 19:04
@jvallesm jvallesm force-pushed the chunhao/ins-6919-pinecone-batch-upsert branch from ef27531 to c74b05a Compare December 11, 2024 06:54
@jvallesm jvallesm force-pushed the chunhao/ins-6919-pinecone-batch-upsert branch from 9399ca7 to 9e87125 Compare December 11, 2024 09:12
@jvallesm jvallesm merged commit 398adf9 into main Dec 11, 2024
11 checks passed
@jvallesm jvallesm deleted the chunhao/ins-6919-pinecone-batch-upsert branch December 11, 2024 09:51
donch1989 pushed a commit that referenced this pull request Dec 11, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.48.5-beta](v0.48.4-beta...v0.48.5-beta)
(2024-12-11)


### Features

* **pinecone:** pinecone batch upsert
([#927](#927))
([398adf9](398adf9))
* **vdp:** upload component input output data
([#923](#923))
([8b6caab](8b6caab))


### Bug Fixes

* **trigger:** add component intermediate data in the trigger
stream/response
([#932](#932))
([2077ae7](2077ae7))
* **trigger:** resolve issue where default value for number cannot be an
integer
([#933](#933))
([134032a](134032a))


### Miscellaneous Chores

* release v0.48.5-beta
([043788d](043788d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants