Skip to content

Commit

Permalink
docs: add docs about parent_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
Askir committed Jan 10, 2025
1 parent 326f93b commit 38c7a93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/python-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ The `vectorizer_relationship` accepts the following parameters:
Additional parameters are simply forwarded to the underlying [SQLAlchemy relationship](https://docs.sqlalchemy.org/en/20/orm/relationships.html) so you can configure it as you desire.

Think of the `vectorizer_relationship` as a normal SQLAlchemy relationship, but with a preconfigured model instance under the hood.

The relationship into the other direction is also automatically set, if you want to change it's configuration you can set the
`parent_kwargs`parameter. E.g. `parent_kwargs={"lazy": "joined"}` to configure eager loading.

## Setting up the Vectorizer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ def test_can_build_select():
to build queries like this would fail.
"""
select(Document.content_embeddings).options(
joinedload(Document.content_embeddings.parent)
joinedload(Document.content_embeddings.parent) # type: ignore
) # type: ignore

0 comments on commit 38c7a93

Please sign in to comment.