From 99b5916c00e98922b5232361bb72a983a3228aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arabov=F0=9F=94=BB?= Date: Tue, 10 Jun 2025 15:52:24 +0300 Subject: [PATCH] Add python_type property to TSVectorType for better type handling --- sqlalchemy_utils/types/ts_vector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqlalchemy_utils/types/ts_vector.py b/sqlalchemy_utils/types/ts_vector.py index 793e6e5f..11845a16 100644 --- a/sqlalchemy_utils/types/ts_vector.py +++ b/sqlalchemy_utils/types/ts_vector.py @@ -84,6 +84,10 @@ class Article(Base): impl = TSVECTOR cache_ok = True + @property + def python_type(self) -> type[str]: + return str + class comparator_factory(TSVECTOR.Comparator): def match(self, other, **kwargs): if 'postgresql_regconfig' not in kwargs: @@ -105,4 +109,4 @@ def __init__(self, *args, **kwargs): """ self.columns = args self.options = kwargs - super().__init__() + super().__init__() \ No newline at end of file