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

Add better error messages for mistaken from_texts and from_documents #342

Merged
merged 4 commits into from
May 13, 2024

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented May 13, 2024

Problem

Sometimes people using Pinecone with Langchain accidentally try to invoke from_texts and from_documents methods on our Pinecone class even though these are not methods by us. This is mostly name-related confusion because Langchain used to have an export called Pinecone that later got renamed to the less ambiguous PineconeVectorStore.

Solution

Add some stub methods to the Pinecone class to guide users in the right direction.

Screenshot 2024-05-13 at 2 36 51 PM

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

Added unit tests. And also an integration test to verify the docs link resolves to a valid page.

@jhamon jhamon requested a review from junefish May 13, 2024 18:38
@jhamon jhamon marked this pull request as ready for review May 13, 2024 18:38
@jhamon jhamon requested a review from zackproser May 13, 2024 18:39
Copy link

@junefish junefish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jhamon jhamon merged commit 0c50e18 into main May 13, 2024
81 checks passed
@jhamon jhamon deleted the jhamon/from-texts-helpful-error branch May 13, 2024 19:12
Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@@ -0,0 +1,4 @@
docslinks = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good thinking. 👍

mcpaddy added a commit to mcpaddy/pinecone-python-client that referenced this pull request May 22, 2024
* 'main' of github.com:pinecone-io/pinecone-python-client:
  [skip ci] Bump version to v4.1.0
  Bump tqdm from 4.66.1 to 4.66.3 (pinecone-io#344)
  Bump idna from 3.4 to 3.7 (pinecone-io#345)
  Bump jinja2 from 3.1.3 to 3.1.4 (pinecone-io#343)
  Add better error messages for mistaken `from_texts` and `from_documents` (pinecone-io#342)
  Support proxy_url and ssl_ca_certs options for gRPC (pinecone-io#341)
  Remove serverless public preview warnings (pinecone-io#340)
  [skip ci] Bump version to v4.0.0
  Improve upsert throughput by 3x (pinecone-io#334)
  Remove `merge` workflow and update `build-and-publish-docs` workflow to be manually runnable (pinecone-io#335)
  [skip ci] Bump version to v3.2.2
  [Fix] openapi_config deprecation warning incorrectly shown (pinecone-io#327)
  Add grpc unit test run, expand testing of VectorFactory (pinecone-io#326)
  [skip ci] Bump version to v3.2.1
  Allow clients to tag requests with a source_tag (pinecone-io#324)
  [skip ci] Bump version to v3.2.0
  Revise proxy configuration, add integration testing (pinecone-io#325)
  [Fix] Configuring SSL proxy via openapi_config object (pinecone-io#321)
  Update README.md (pinecone-io#323)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants