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

vector_store.create_collection() fails: AttributeError: 'NoneType' object has no attribute 'get_or_create' #27

Open
amotl opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@amotl
Copy link
Member

amotl commented Jan 29, 2025

Problem

    def create_collection(self) -> None:
        if self.pre_delete_collection:
            self.delete_collection()
        with self._make_sync_session() as session:
>           self.CollectionStore.get_or_create(
                session, self.collection_name, cmetadata=self.collection_metadata
            )
E           AttributeError: 'NoneType' object has no attribute 'get_or_create'

.venv/lib/python3.12/site-packages/langchain_postgres/vectorstores.py:542: AttributeError
@amotl
Copy link
Member Author

amotl commented Jan 29, 2025

After helping with vector_store._init_models_with_dimensionality(3), it fails when invoking vector_store.create_collection().

E               sqlalchemy.exc.ProgrammingError: (crate.client.exceptions.ProgrammingError) RelationUnknown[Relation 'langchain_collection' unknown]
E               [SQL: SELECT langchain_collection.uuid AS langchain_collection_uuid, langchain_collection.name AS langchain_collection_name, langchain_collection.cmetadata AS langchain_collection_cmetadata
E               FROM langchain_collection
E               WHERE langchain_collection.name = ?
E                LIMIT ?]
E               [parameters: ('test_collection', 1)]
E               (Background on this error at: https://sqlalche.me/e/20/f405)

.venv/lib/python3.12/site-packages/crate/client/http.py:238: ProgrammingError

@amotl amotl changed the title vectorstore.create_collection() fails: AttributeError: 'NoneType' object has no attribute 'get_or_create' vector_store.create_collection() fails: AttributeError: 'NoneType' object has no attribute 'get_or_create' Jan 29, 2025
@amotl amotl self-assigned this Jan 29, 2025
@amotl amotl added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant