@@ -161,39 +161,39 @@ def test_vector_process_result_value_returns_list_for_plain_iterable() -> None:
161161
162162def test_vector_distance_methods_exist_on_column () -> None :
163163 """``Vector`` columns expose pgvector-compatible distance comparator methods."""
164- column = Column ("embedding" , Vector (3 ))
164+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
165165 assert hasattr (column , "cosine_distance" )
166166 assert hasattr (column , "l2_distance" )
167167 assert hasattr (column , "max_inner_product" )
168168
169169
170170def test_vector_cosine_distance_postgresql_emits_operator () -> None :
171171 """Cosine distance compiles to the pgvector ``<=>`` operator on PostgreSQL."""
172- column = Column ("embedding" , Vector (3 ))
172+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
173173 statement = column .cosine_distance ([1.0 , 2.0 , 3.0 ])
174174 sql = str (statement .compile (dialect = postgresql_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
175175 assert "<=>" in sql
176176
177177
178178def test_vector_l2_distance_postgresql_emits_operator () -> None :
179179 """L2 distance compiles to the pgvector ``<->`` operator on PostgreSQL."""
180- column = Column ("embedding" , Vector (3 ))
180+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
181181 statement = column .l2_distance ([1.0 , 2.0 , 3.0 ])
182182 sql = str (statement .compile (dialect = postgresql_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
183183 assert "<->" in sql
184184
185185
186186def test_vector_max_inner_product_postgresql_emits_operator () -> None :
187187 """Negative inner product compiles to the pgvector ``<#>`` operator on PostgreSQL."""
188- column = Column ("embedding" , Vector (3 ))
188+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
189189 statement = column .max_inner_product ([1.0 , 2.0 , 3.0 ])
190190 sql = str (statement .compile (dialect = postgresql_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
191191 assert "<#>" in sql
192192
193193
194194def test_vector_cosine_distance_oracle_emits_vector_distance () -> None :
195195 """Cosine distance compiles to ``VECTOR_DISTANCE(..., COSINE)`` on Oracle 23ai."""
196- column = Column ("embedding" , Vector (3 ))
196+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
197197 statement = column .cosine_distance ([1.0 , 2.0 , 3.0 ])
198198 sql = str (statement .compile (dialect = oracle_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
199199 assert "VECTOR_DISTANCE" in sql
@@ -202,7 +202,7 @@ def test_vector_cosine_distance_oracle_emits_vector_distance() -> None:
202202
203203def test_vector_l2_distance_oracle_uses_euclidean_metric () -> None :
204204 """L2 distance maps to the Oracle ``EUCLIDEAN`` metric."""
205- column = Column ("embedding" , Vector (3 ))
205+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
206206 statement = column .l2_distance ([1.0 , 2.0 , 3.0 ])
207207 sql = str (statement .compile (dialect = oracle_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
208208 assert "VECTOR_DISTANCE" in sql
@@ -211,7 +211,7 @@ def test_vector_l2_distance_oracle_uses_euclidean_metric() -> None:
211211
212212def test_vector_max_inner_product_oracle_uses_dot_metric () -> None :
213213 """Negative inner product maps to the Oracle ``DOT`` metric."""
214- column = Column ("embedding" , Vector (3 ))
214+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
215215 statement = column .max_inner_product ([1.0 , 2.0 , 3.0 ])
216216 sql = str (statement .compile (dialect = oracle_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
217217 assert "VECTOR_DISTANCE" in sql
@@ -220,7 +220,7 @@ def test_vector_max_inner_product_oracle_uses_dot_metric() -> None:
220220
221221def test_vector_distance_unsupported_dialect_raises () -> None :
222222 """Distance operations require a native vector backend; JSON fallback raises clearly."""
223- column = Column ("embedding" , Vector (3 ))
223+ column : Column [ list [ float ]] = Column ("embedding" , Vector (3 ))
224224 statement = column .cosine_distance ([1.0 , 2.0 , 3.0 ])
225225 with pytest .raises (NotImplementedError ):
226226 str (statement .compile (dialect = sqlite_dialect_mod .dialect ())) # type: ignore[no-untyped-call,unused-ignore]
0 commit comments