pyobvector 0.2.14__tar.gz → 0.2.16__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.
Files changed (36) hide show
  1. {pyobvector-0.2.14 → pyobvector-0.2.16}/PKG-INFO +2 -2
  2. {pyobvector-0.2.14 → pyobvector-0.2.16}/README.md +1 -1
  3. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/exceptions.py +1 -1
  4. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/milvus_like_client.py +2 -2
  5. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/reflection.py +13 -12
  6. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyproject.toml +1 -1
  7. {pyobvector-0.2.14 → pyobvector-0.2.16}/LICENSE +0 -0
  8. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/__init__.py +0 -0
  9. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/__init__.py +0 -0
  10. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/collection_schema.py +0 -0
  11. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/enum.py +0 -0
  12. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/fts_index_param.py +0 -0
  13. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/index_param.py +0 -0
  14. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/ob_vec_client.py +0 -0
  15. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/ob_vec_json_table_client.py +0 -0
  16. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/partitions.py +0 -0
  17. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/client/schema_type.py +0 -0
  18. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/json_table/__init__.py +0 -0
  19. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/json_table/json_value_returning_func.py +0 -0
  20. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/json_table/oceanbase_dialect.py +0 -0
  21. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/json_table/virtual_data_type.py +0 -0
  22. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/__init__.py +0 -0
  23. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/array.py +0 -0
  24. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/dialect.py +0 -0
  25. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/full_text_index.py +0 -0
  26. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/geo_srid_point.py +0 -0
  27. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/gis_func.py +0 -0
  28. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/match_against_func.py +0 -0
  29. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/ob_table.py +0 -0
  30. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/replace_stmt.py +0 -0
  31. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/vec_dist_func.py +0 -0
  32. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/vector.py +0 -0
  33. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/schema/vector_index.py +0 -0
  34. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/util/__init__.py +0 -0
  35. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/util/ob_version.py +0 -0
  36. {pyobvector-0.2.14 → pyobvector-0.2.16}/pyobvector/util/vector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyobvector
3
- Version: 0.2.14
3
+ Version: 0.2.16
4
4
  Summary: A python SDK for OceanBase Vector Store, based on SQLAlchemy, compatible with Milvus API.
5
5
  Author: shanhaikang.shk
6
6
  Author-email: shanhaikang.shk@oceanbase.com
@@ -36,7 +36,7 @@ poetry install
36
36
  - install with pip:
37
37
 
38
38
  ```shell
39
- pip install pyobvector==0.2.14
39
+ pip install pyobvector==0.2.16
40
40
  ```
41
41
 
42
42
  ## Build Doc
@@ -15,7 +15,7 @@ poetry install
15
15
  - install with pip:
16
16
 
17
17
  ```shell
18
- pip install pyobvector==0.2.14
18
+ pip install pyobvector==0.2.16
19
19
  ```
20
20
 
21
21
  ## Build Doc
@@ -108,7 +108,7 @@ class ExceptionsMessage:
108
108
  )
109
109
  CollectionNotExists = "Collection does not exist."
110
110
  MetricTypeParamTypeInvalid = "MetricType param type should be string."
111
- MetricTypeValueInvalid = "MetricType should be 'l2'/'ip' in ann search."
111
+ MetricTypeValueInvalid = "MetricType should be 'l2'/'ip'/'neg_ip'/'cosine' in ann search."
112
112
  UsingInIDsWhenMultiPrimaryKey = "Using 'ids' when table has multi primary key."
113
113
  ClusterVersionIsLow = (
114
114
  "OceanBase Vector Store is not supported because cluster version is below 4.3.3.0."
@@ -379,8 +379,8 @@ class MilvusLikeClient(Client):
379
379
  )
380
380
  lower_metric_type_str = search_params["metric_type"].lower()
381
381
  if lower_metric_type_str not in (
382
- "l2", "neg_ip"
383
- ): # For OceanBase, only support l2/ip distance in ann_search
382
+ "l2", "neg_ip", "cosine", "ip"
383
+ ):
384
384
  raise VectorMetricTypeException(
385
385
  code=ErrorCode.INVALID_ARGUMENT,
386
386
  message=ExceptionsMessage.MetricTypeValueInvalid,
@@ -49,10 +49,12 @@ class OceanBaseTableDefinitionParser(MySQLTableDefinitionParser):
49
49
  # r"(?:(?P<type>\S+) )?KEY"
50
50
  r"(?: +{iq}(?P<name>(?:{esc_fq}|[^{fq}])+){fq})?"
51
51
  r"(?: +USING +(?P<using_pre>\S+))?"
52
- r" +\((?P<columns>.+?)\)"
52
+ r" +\((?P<columns>[^)]+)\)"
53
53
  r"(?: +USING +(?P<using_post>\S+))?"
54
- r"(?: +(KEY_)?BLOCK_SIZE *[ =]? *(?P<keyblock>\S+) *(LOCAL)?)?"
54
+ r"(?: +WITH +\((?P<vector_params>[^)]+)\))?"
55
55
  r"(?: +WITH PARSER +(?P<parser>\S+))?"
56
+ r"(?: +PARSER_PROPERTIES=\((?P<parser_properties>[^)]+)\))?"
57
+ r"(?: +(KEY_)?BLOCK_SIZE *[ =]? *(?P<keyblock>\S+) *(LOCAL)?)?"
56
58
  r"(?: +COMMENT +(?P<comment>(\x27\x27|\x27([^\x27])*?\x27)+))?"
57
59
  r"(?: +/\*(?P<version_sql>.+)\*/ *)?"
58
60
  r",?$".format(iq=quotes["iq"], esc_fq=quotes["esc_fq"], fq=quotes["fq"])
@@ -137,16 +139,15 @@ class OceanBaseTableDefinitionParser(MySQLTableDefinitionParser):
137
139
  if ret:
138
140
  tp, spec = ret
139
141
 
140
- if tp is None:
141
- return ret
142
- if tp == "partition":
143
- # do not handle partition
142
+ if tp is None or tp == "partition" or not isinstance(spec, dict):
144
143
  return ret
144
+
145
145
  if tp == "fk_constraint":
146
- if len(spec["table"]) == 2 and spec["table"][0] == self.default_schema:
147
- spec["table"] = spec["table"][1:]
148
- if spec.get("onupdate", "").lower() == "restrict":
149
- spec["onupdate"] = None
150
- if spec.get("ondelete", "").lower() == "restrict":
151
- spec["ondelete"] = None
146
+ table = spec.get("table", [])
147
+ if isinstance(table, list) and len(table) == 2 and table[0] == self.default_schema:
148
+ spec["table"] = table[1:]
149
+
150
+ for action in ["onupdate", "ondelete"]:
151
+ if (spec.get(action) or "").lower() == "restrict":
152
+ spec[action] = None
152
153
  return ret
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyobvector"
3
- version = "0.2.14"
3
+ version = "0.2.16"
4
4
  description = "A python SDK for OceanBase Vector Store, based on SQLAlchemy, compatible with Milvus API."
5
5
  authors = ["shanhaikang.shk <shanhaikang.shk@oceanbase.com>"]
6
6
  readme = "README.md"
File without changes