corvic-engine 0.3.0rc76__cp38-abi3-win_amd64.whl → 0.3.0rc77__cp38-abi3-win_amd64.whl
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.
- corvic/engine/_native.pyd +0 -0
- corvic/model/_base_model.py +20 -16
- {corvic_engine-0.3.0rc76.dist-info → corvic_engine-0.3.0rc77.dist-info}/METADATA +1 -1
- {corvic_engine-0.3.0rc76.dist-info → corvic_engine-0.3.0rc77.dist-info}/RECORD +6 -6
- {corvic_engine-0.3.0rc76.dist-info → corvic_engine-0.3.0rc77.dist-info}/WHEEL +0 -0
- {corvic_engine-0.3.0rc76.dist-info → corvic_engine-0.3.0rc77.dist-info}/licenses/LICENSE +0 -0
corvic/engine/_native.pyd
CHANGED
Binary file
|
corvic/model/_base_model.py
CHANGED
@@ -204,14 +204,8 @@ class BaseModel(Generic[ID, ProtoObj, OrmObj], UsesOrmID[ID, ProtoObj]):
|
|
204
204
|
self.proto_self, session
|
205
205
|
).unwrap_or_raise()
|
206
206
|
session.commit()
|
207
|
-
except sa.exc.
|
208
|
-
|
209
|
-
return InvalidArgumentError.from_(err)
|
210
|
-
if "could not serialize access due to concurrent update" in str(err):
|
211
|
-
return UnavailableError.from_(err)
|
212
|
-
return InvalidArgumentError.from_(err)
|
213
|
-
except (sa.exc.DatabaseError, sa.exc.StatementError) as err:
|
214
|
-
return InvalidArgumentError.from_(err)
|
207
|
+
except sa.exc.DBAPIError as err:
|
208
|
+
return self._dbapi_error_to_result(err)
|
215
209
|
return Ok(
|
216
210
|
self.__class__(
|
217
211
|
client=self.client,
|
@@ -219,6 +213,22 @@ class BaseModel(Generic[ID, ProtoObj, OrmObj], UsesOrmID[ID, ProtoObj]):
|
|
219
213
|
)
|
220
214
|
)
|
221
215
|
|
216
|
+
@staticmethod
|
217
|
+
def _dbapi_error_to_result(err: sa.exc.DBAPIError):
|
218
|
+
try:
|
219
|
+
import psycopg.errors
|
220
|
+
|
221
|
+
if isinstance(err.orig, psycopg.errors.SerializationFailure):
|
222
|
+
return UnavailableError.from_(err)
|
223
|
+
except ModuleNotFoundError:
|
224
|
+
pass
|
225
|
+
if isinstance(err, sa.exc.ProgrammingError):
|
226
|
+
if "violates foreign key constraint" in str(err):
|
227
|
+
return InvalidArgumentError.from_(err)
|
228
|
+
if "could not serialize access due to concurrent update" in str(err):
|
229
|
+
return UnavailableError.from_(err)
|
230
|
+
return InvalidArgumentError.from_(err)
|
231
|
+
|
222
232
|
def add_to_session(
|
223
233
|
self, session: orm.Session
|
224
234
|
) -> Ok[None] | InvalidArgumentError | UnavailableError:
|
@@ -232,14 +242,8 @@ class BaseModel(Generic[ID, ProtoObj, OrmObj], UsesOrmID[ID, ProtoObj]):
|
|
232
242
|
_ = self.proto_to_orm(self.proto_self, session).unwrap_or_raise()
|
233
243
|
session.flush()
|
234
244
|
# TODO(thunt): Possibly separate out DatabaseError into a precondition error
|
235
|
-
except sa.exc.
|
236
|
-
|
237
|
-
return InvalidArgumentError.from_(err)
|
238
|
-
if "could not serialize access due to concurrent update" in str(err):
|
239
|
-
return UnavailableError.from_(err)
|
240
|
-
return InvalidArgumentError.from_(err)
|
241
|
-
except (sa.exc.DatabaseError, sa.exc.StatementError) as err:
|
242
|
-
return InvalidArgumentError.from_(err)
|
245
|
+
except sa.exc.DBAPIError as err:
|
246
|
+
return self._dbapi_error_to_result(err)
|
243
247
|
return Ok(None)
|
244
248
|
|
245
249
|
def delete(self) -> Ok[Self] | NotFoundError | InvalidArgumentError:
|
@@ -11,11 +11,11 @@ corvic/embedding_metric/__init__.py,sha256=8a-QKSQNbiksueHk5LdkugjZr6wasP4ff8A-J
|
|
11
11
|
corvic/embedding_metric/embeddings.py,sha256=XCiMzoGdRSmCOJnBDnxm3xlU0L_vrXwUxEjwdMv1FMI,14036
|
12
12
|
corvic/embedding_metric/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
corvic/engine/__init__.py,sha256=XL4Vg7rNcBi29ccVelpeFizR9oJtGYXDn84W9zok9d4,975
|
14
|
-
corvic/engine/_native.pyd,sha256=
|
14
|
+
corvic/engine/_native.pyd,sha256=oZ8tiGVOEcQUbgEFzM24eDwxgdUxcCCc87cR9f24ZuM,438272
|
15
15
|
corvic/engine/_native.pyi,sha256=KYMPtvXqHZ-jMgZohLf4se3rr-rBpCihmjANcr6s8ag,1390
|
16
16
|
corvic/engine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
corvic/model/__init__.py,sha256=ZtMq8LTJE013v-OoVq0muo0aqomNGrjmXwKfS8wd4CU,3075
|
18
|
-
corvic/model/_base_model.py,sha256=
|
18
|
+
corvic/model/_base_model.py,sha256=dgoCvxhroX0Bp21r7LhO69rZCBJyf8zio9UaLqpM1iQ,10263
|
19
19
|
corvic/model/_completion_model.py,sha256=HMp3yCgRtPUUf0KMAw5GoVXAlrfPhQ9h6ytEIkY9yEs,7634
|
20
20
|
corvic/model/_defaults.py,sha256=yoKPPSmYJCE5YAD5jLTEmT4XNf_zXoggNK-uyG8MfVs,1524
|
21
21
|
corvic/model/_errors.py,sha256=Ctlq04SDwHzJPvLaL1rzqzwVqf2b50EILfW3cH4vnh8,261
|
@@ -94,9 +94,9 @@ corvic/version/__init__.py,sha256=JlkRLvKXsu3zIxhdynO_0Ub5NfQOvGjfwCRkNnaOu9U,11
|
|
94
94
|
corvic/version/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
95
|
corvic/well_known_types/__init__.py,sha256=Btbeqieik2AcmijeOXeqBptzueBpgNitvH9J5VNm12w,1289
|
96
96
|
corvic/well_known_types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
|
-
corvic_engine-0.3.
|
98
|
-
corvic_engine-0.3.
|
99
|
-
corvic_engine-0.3.
|
97
|
+
corvic_engine-0.3.0rc77.dist-info/METADATA,sha256=-HhsUDmdXgIY4oR16Ib9bpTQEcLaIf_m-Bl-7vEa4x4,1814
|
98
|
+
corvic_engine-0.3.0rc77.dist-info/WHEEL,sha256=qo08K5WTt1v9liGoFGXfI182ciKs5521XAErJtzFynQ,94
|
99
|
+
corvic_engine-0.3.0rc77.dist-info/licenses/LICENSE,sha256=DSS1OD0oIgssKOmAzkMRBv5jvvVuZQbrIv8lpl9DXY8,1035
|
100
100
|
corvic_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
101
|
corvic_generated/algorithm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
102
102
|
corvic_generated/algorithm/graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -207,4 +207,4 @@ corvic_generated/status/v1/service_pb2.py,sha256=CKXPX2ahq8O4cFhPpt6wo6l--6VZcgj
|
|
207
207
|
corvic_generated/status/v1/service_pb2.pyi,sha256=iXLR2FOKQJpBgvBzpD2kVwcYOCksP2aRwK4JYaI9CBw,558
|
208
208
|
corvic_generated/status/v1/service_pb2_grpc.py,sha256=y-a5ldrphWlNJW-yKswyjNmXokK4-5bbEEfczjagJHo,2736
|
209
209
|
corvic_generated/status/v1/service_pb2_grpc.pyi,sha256=OoAnaZ64FD0UTzPoRhYvQU8ecoilhHj3ySjSfHbVDaU,1501
|
210
|
-
corvic_engine-0.3.
|
210
|
+
corvic_engine-0.3.0rc77.dist-info/RECORD,,
|
File without changes
|
File without changes
|