Skip to content

Commit b34f1c9

Browse files
committed
Updated examples [skip ci]
1 parent 6d8db07 commit b34f1c9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/implicit/example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import implicit
22
from implicit.datasets.movielens import get_movielens
3-
from pgvector.sqlalchemy import Vector
3+
from pgvector.sqlalchemy import VECTOR
44
from sqlalchemy import create_engine, insert, select, text, Integer, String
55
from sqlalchemy.orm import declarative_base, mapped_column, Session
66

@@ -16,15 +16,15 @@ class User(Base):
1616
__tablename__ = 'user'
1717

1818
id = mapped_column(Integer, primary_key=True)
19-
factors = mapped_column(Vector(20))
19+
factors = mapped_column(VECTOR(20))
2020

2121

2222
class Item(Base):
2323
__tablename__ = 'item'
2424

2525
id = mapped_column(Integer, primary_key=True)
2626
title = mapped_column(String)
27-
factors = mapped_column(Vector(20))
27+
factors = mapped_column(VECTOR(20))
2828

2929

3030
Base.metadata.drop_all(engine)

examples/lightfm/example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from lightfm import LightFM
22
from lightfm.datasets import fetch_movielens
3-
from pgvector.sqlalchemy import Vector
3+
from pgvector.sqlalchemy import VECTOR
44
from sqlalchemy import create_engine, insert, select, text, Float, Integer, String
55
from sqlalchemy.orm import declarative_base, mapped_column, Session
66

@@ -16,15 +16,15 @@ class User(Base):
1616
__tablename__ = 'user'
1717

1818
id = mapped_column(Integer, primary_key=True)
19-
factors = mapped_column(Vector(20))
19+
factors = mapped_column(VECTOR(20))
2020

2121

2222
class Item(Base):
2323
__tablename__ = 'item'
2424

2525
id = mapped_column(Integer, primary_key=True)
2626
title = mapped_column(String)
27-
factors = mapped_column(Vector(20))
27+
factors = mapped_column(VECTOR(20))
2828
bias = mapped_column(Float)
2929

3030

examples/surprise/example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pgvector.sqlalchemy import Vector
1+
from pgvector.sqlalchemy import VECTOR
22
from sqlalchemy import create_engine, insert, select, text, Integer
33
from sqlalchemy.orm import declarative_base, mapped_column, Session
44
from surprise import Dataset, SVD
@@ -15,14 +15,14 @@ class User(Base):
1515
__tablename__ = 'user'
1616

1717
id = mapped_column(Integer, primary_key=True)
18-
factors = mapped_column(Vector(20))
18+
factors = mapped_column(VECTOR(20))
1919

2020

2121
class Item(Base):
2222
__tablename__ = 'item'
2323

2424
id = mapped_column(Integer, primary_key=True)
25-
factors = mapped_column(Vector(20))
25+
factors = mapped_column(VECTOR(20))
2626

2727

2828
Base.metadata.drop_all(engine)

0 commit comments

Comments
 (0)