pyobvector 0.2.25__tar.gz → 0.2.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyobvector-0.2.25 → pyobvector-0.2.26}/PKG-INFO +2 -2
- {pyobvector-0.2.25 → pyobvector-0.2.26}/README.md +1 -1
- {pyobvector-0.2.25 → pyobvector-0.2.26}/RELEASE_NOTES.md +4 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/ob_vec_json_table_client.py +2 -1
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/json_table/oceanbase_dialect.py +21 -9
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyproject.toml +1 -1
- {pyobvector-0.2.25 → pyobvector-0.2.26}/.github/workflows/ci.yml +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/.github/workflows/python-publish.yml +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/.gitignore +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/.pre-commit-config.yaml +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/.pylintrc +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/LICENSE +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/Makefile +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/collection_schema.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/enum.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/exceptions.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/fts_index_param.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/hybrid_search.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/index_param.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/milvus_like_client.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/ob_client.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/ob_vec_client.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/partitions.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/schema_type.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/client/seekdb_engine.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/json_table/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/json_table/json_value_returning_func.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/json_table/virtual_data_type.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/array.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/dialect.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/full_text_index.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/geo_srid_point.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/gis_func.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/match_against_func.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/ob_table.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/reflection.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/replace_stmt.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/sparse_vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/vec_dist_func.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/schema/vector_index.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/util/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/util/ob_version.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/util/sparse_vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/pyobvector/util/vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/conf.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/index.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/modules.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/pyobvector.client.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/pyobvector.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/pyobvector.schema.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/source/pyobvector.util.rst +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/__init__.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_fts_index.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_geometry.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_hybrid_search.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_json_table.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_milvus_like_client.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_milvus_like_client_sparse_vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_ob_vec_client.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_ob_vec_client_sparse_vector.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_ob_vec_more_algorithm.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_oceanbase_dialect.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_partition_compile.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_reflection.py +0 -0
- {pyobvector-0.2.25 → pyobvector-0.2.26}/tests/test_seekdb_embedded.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyobvector
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.26
|
|
4
4
|
Summary: A python SDK for OceanBase Vector Store, based on SQLAlchemy, compatible with Milvus API.
|
|
5
5
|
Project-URL: Homepage, https://github.com/oceanbase/pyobvector
|
|
6
6
|
Project-URL: Repository, https://github.com/oceanbase/pyobvector.git
|
|
@@ -36,7 +36,7 @@ uv sync
|
|
|
36
36
|
- install with pip:
|
|
37
37
|
|
|
38
38
|
```shell
|
|
39
|
-
pip install pyobvector==0.2.
|
|
39
|
+
pip install pyobvector==0.2.26
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
- for **embedded SeekDB** support (local SeekDB without server):
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file documents all released versions and their notable changes for the pyobvector project. Changes are grouped by version and categorized as Added (new features), Changed (modifications), Fixed (bug fixes), and Security (security updates).
|
|
4
4
|
|
|
5
|
+
## [0.2.26](https://github.com/oceanbase/pyobvector/compare/release-v0.2.25...release-v0.2.26) - 2026-04-15
|
|
6
|
+
|
|
7
|
+
-Fix: Compatible with the latest version of sqlglot
|
|
8
|
+
|
|
5
9
|
## [0.2.25](https://github.com/oceanbase/pyobvector/compare/release-v0.2.24...release-v0.2.25) - 2026-03-10
|
|
6
10
|
|
|
7
11
|
- Fix: preserve table options when adding sparse vector indexes
|
|
@@ -15,7 +15,8 @@ from sqlalchemy import (
|
|
|
15
15
|
)
|
|
16
16
|
from sqlalchemy.dialects.mysql import TINYINT
|
|
17
17
|
from sqlalchemy.orm import declarative_base, sessionmaker, Session
|
|
18
|
-
from sqlglot import parse_one, exp,
|
|
18
|
+
from sqlglot import parse_one, exp, to_identifier
|
|
19
|
+
from sqlglot.expressions import Expression
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
from .ob_vec_client import ObVecClient
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import sqlglot as _sqlglot
|
|
2
|
+
|
|
3
|
+
from sqlglot import parser, exp
|
|
4
|
+
from sqlglot.expressions import Expression
|
|
2
5
|
from sqlglot.dialects.mysql import MySQL
|
|
3
6
|
from sqlglot.tokens import TokenType
|
|
4
7
|
|
|
8
|
+
# sqlglot 30+ passes a pre-built expression into Parser.expression(); older versions
|
|
9
|
+
# pass the class and kwargs separately.
|
|
10
|
+
_SQLGLOT_GE_30 = int(_sqlglot.__version__.split(".", 1)[0]) >= 30
|
|
11
|
+
|
|
5
12
|
|
|
6
13
|
class ChangeColumn(Expression):
|
|
7
14
|
arg_types = {
|
|
@@ -29,6 +36,11 @@ class OceanBase(MySQL):
|
|
|
29
36
|
"CHANGE": lambda self: self._parse_change_table_column(),
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
def _make_expression(self, expr_cls: type, **kwargs):
|
|
40
|
+
if _SQLGLOT_GE_30:
|
|
41
|
+
return self.expression(expr_cls(**kwargs))
|
|
42
|
+
return self.expression(expr_cls, **kwargs)
|
|
43
|
+
|
|
32
44
|
def _parse_alter_table_alter(self) -> exp.Expression | None:
|
|
33
45
|
if self._match_texts(self.ALTER_ALTER_PARSERS):
|
|
34
46
|
return self.ALTER_ALTER_PARSERS[self._prev.text.upper()](self)
|
|
@@ -37,31 +49,31 @@ class OceanBase(MySQL):
|
|
|
37
49
|
column = self._parse_field_def()
|
|
38
50
|
|
|
39
51
|
if self._match_pair(TokenType.DROP, TokenType.DEFAULT):
|
|
40
|
-
return self.
|
|
52
|
+
return self._make_expression(exp.AlterColumn, this=column, drop=True)
|
|
41
53
|
if self._match_pair(TokenType.SET, TokenType.DEFAULT):
|
|
42
|
-
return self.
|
|
54
|
+
return self._make_expression(
|
|
43
55
|
exp.AlterColumn, this=column, default=self._parse_assignment()
|
|
44
56
|
)
|
|
45
57
|
if self._match(TokenType.COMMENT):
|
|
46
|
-
return self.
|
|
58
|
+
return self._make_expression(
|
|
47
59
|
exp.AlterColumn, this=column, comment=self._parse_string()
|
|
48
60
|
)
|
|
49
61
|
if self._match_text_seq("DROP", "NOT", "NULL"):
|
|
50
|
-
return self.
|
|
62
|
+
return self._make_expression(
|
|
51
63
|
exp.AlterColumn,
|
|
52
64
|
this=column,
|
|
53
65
|
drop=True,
|
|
54
66
|
allow_null=True,
|
|
55
67
|
)
|
|
56
68
|
if self._match_text_seq("SET", "NOT", "NULL"):
|
|
57
|
-
return self.
|
|
69
|
+
return self._make_expression(
|
|
58
70
|
exp.AlterColumn,
|
|
59
71
|
this=column,
|
|
60
72
|
allow_null=False,
|
|
61
73
|
)
|
|
62
74
|
self._match_text_seq("SET", "DATA")
|
|
63
75
|
self._match_text_seq("TYPE")
|
|
64
|
-
return self.
|
|
76
|
+
return self._make_expression(
|
|
65
77
|
exp.AlterColumn,
|
|
66
78
|
this=column,
|
|
67
79
|
dtype=self._parse_types(),
|
|
@@ -95,7 +107,7 @@ class OceanBase(MySQL):
|
|
|
95
107
|
else:
|
|
96
108
|
expressions = None
|
|
97
109
|
|
|
98
|
-
return self.
|
|
110
|
+
return self._make_expression(
|
|
99
111
|
exp.Drop,
|
|
100
112
|
exists=if_exists,
|
|
101
113
|
this=this,
|
|
@@ -114,7 +126,7 @@ class OceanBase(MySQL):
|
|
|
114
126
|
self._match(TokenType.COLUMN)
|
|
115
127
|
origin_col = self._parse_field(any_token=True)
|
|
116
128
|
column = self._parse_field()
|
|
117
|
-
return self.
|
|
129
|
+
return self._make_expression(
|
|
118
130
|
ChangeColumn,
|
|
119
131
|
this=column,
|
|
120
132
|
origin_col_name=origin_col,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyobvector"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.26"
|
|
4
4
|
description = "A python SDK for OceanBase Vector Store, based on SQLAlchemy, compatible with Milvus API."
|
|
5
5
|
authors = [{name="shanhaikang.shk",email="shanhaikang.shk@oceanbase.com"}]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|