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

Detect plugins for Index and IndexGRPC classes #402

Merged
merged 5 commits into from
Oct 28, 2024

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented Oct 22, 2024

Problem

Plugins not detected for Index/IndexGRPC classes

Solution

  • Copy and modify installation method in pinecone.py used for Pinecone and PineconeGRPC classes.
  • For IndexGRPC, pass in a stub function.

Type of Change

  • 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

To really validate this will probably require making a dev build release and installing alongside some actual plugins.

@jhamon jhamon marked this pull request as ready for review October 22, 2024 19:10
Comment on lines +28 to +34
from ..utils import (
setup_openapi_client,
parse_non_empty_args,
build_plugin_setup_client,
validate_and_convert_errors,
)
from .features.bulk_import import ImportFeatureMixin
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Most of these import changes are just cosmetic

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.

LGTM and makes sense. I'll take the dev build and get it tested with a plugin before we merge and move on, but thanks for getting this together.

# try block just in case to make sure a bad plugin doesn't
# halt client initialization.
openapi_client_builder = build_plugin_setup_client(
config=self.config,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be self._config. Currently seeing this error when it attempts to apply plugins to Index:

ERROR    pinecone.data.index:index.py:129 Error loading plugins in Index: 'Index' object has no attribute 'config'

@jhamon jhamon merged commit 36373a1 into main Oct 28, 2024
161 of 163 checks passed
@jhamon jhamon deleted the jhamon/index-plugin-detection branch October 28, 2024 20:14
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.

2 participants