[Fix] Module can be imported even when incompatible grpc deps are present #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When installing
pinecone-client
alongside other packages that include GRPC dependencies, imports may succeed even though the grpc dependencies are not sufficient for our GRPC code to be loaded correctly. This causes the entire module import to fail in some situations because the error thrown is some other runtime error (e.g.AttributeError
instead ofImportError
in the bug report we received) we are not catching.This seems like a general problem in the python ecosystem, since there's no easy way to tell whether extras were installed and dependency requirements met other than try running and see what happens.
Solution
GRPC: Catch all exceptions, not just
ImportError
Workflow changes are unrelated, but necessary to release a dev build with this change. Seems like the nightly build has been broken since the poetry changes were merged last week because version numbers are stored in a different place now.
Type of Change
Test Plan
Make a dev build, see if that can install