@@ -821,6 +821,7 @@ def create_cursor(self):
821
821
}
822
822
if sqlalchemy_version .startswith ("2." ):
823
823
from .types import IRISUniqueIdentifier
824
+
824
825
colspecs [sqltypes .UUID ] = IRISUniqueIdentifier
825
826
826
827
@@ -910,30 +911,22 @@ def on_connect(conn):
910
911
if super_ is not None :
911
912
super_ (conn )
912
913
913
- if self .embedded :
914
- self .supports_vectors = (
915
- conn .iris .cls ("%SYSTEM.License" ).GetFeature (28 ) == 1
916
- )
917
- else :
918
- try :
919
- with conn .cursor () as cursor :
920
- cursor .execute (text ("SELECT TO_VECTOR('1,2,3', INT, 3)" ))
921
- self .supports_vectors = True
922
- except : # noqa
923
- self .supports_vectors = False
924
- if self .supports_vectors :
914
+ try :
925
915
with conn .cursor () as cursor :
926
916
# Distance or similarity
927
917
cursor .execute (
928
918
"select vector_cosine(to_vector('1'), to_vector('1'))"
929
919
)
930
- self .vector_cosine_similarity = cursor .fetchone ()[0 ] == 0
931
-
920
+ self .supports_vectors = True
921
+ except : # noqa
922
+ self .supports_vectors = False
932
923
self ._dictionary_access = False
933
924
with conn .cursor () as cursor :
934
925
cursor .execute ("%CHECKPRIV SELECT ON %Dictionary.PropertyDefinition" )
935
926
self ._dictionary_access = cursor .sqlcode == 0
936
927
928
+ if not self .supports_vectors :
929
+ util .warn ("No native support for VECTOR or not activated by license" )
937
930
if not self ._dictionary_access :
938
931
util .warn (
939
932
"""
0 commit comments