Skip to content

Add better error messages for mistaken from_texts and from_documents - #342

Merged
jhamon merged 4 commits into
mainfrom
jhamon/from-texts-helpful-error
May 13, 2024
Merged

jhamon merged 4 commits into
mainfrom
jhamon/from-texts-helpful-error

Conversation

@jhamon

@jhamon jhamon commented May 13, 2024

Copy link
Copy Markdown
Collaborator

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

@junefish junefish left a comment

Copy link
Copy Markdown

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
@jhamon
jhamon deleted the jhamon/from-texts-helpful-error branch May 13, 2024 19:12

@austin-denoble austin-denoble left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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)
NishchayMahor pushed a commit to NishchayMahor/python-sdk-1 that referenced this pull request Sep 22, 2026
…ired (pinecone-io#342) (pinecone-io#356)

The six total_timeout expiry tests set the fake's `released` event after
`upsert_from_dataframe` returns, but the call cannot return until the
in-flight batch settles and that batch is the one blocked in
`_StallingChannel.upsert`. The release therefore always arrived too late
to shorten anything and each test paid the 2.0s fallback wait in full.

A releaser thread now unblocks the fake `_TOTAL_TIMEOUT + _RELEASE_MARGIN`
past the stall, which is strictly after the ingest's deadline because the
deadline starts before the stall. Expiry still happens with a batch
genuinely in flight; no assertion changed. The 2.0s wait stays as the
backstop against a real hang.

Per-test wall time drops 2.01s -> 0.26s, the module 12.26s -> 1.75s, and
tests/unit 84.64s -> 77.36s at an unchanged 7342 passed / 11 skipped.
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