corvic-engine 0.3.0rc71__cp38-abi3-win_amd64.whl → 0.3.0rc73__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/_pipeline.py +54 -0
- corvic/model/_proto_orm_convert.py +36 -26
- {corvic_engine-0.3.0rc71.dist-info → corvic_engine-0.3.0rc73.dist-info}/METADATA +1 -1
- {corvic_engine-0.3.0rc71.dist-info → corvic_engine-0.3.0rc73.dist-info}/RECORD +7 -7
- {corvic_engine-0.3.0rc71.dist-info → corvic_engine-0.3.0rc73.dist-info}/WHEEL +0 -0
- {corvic_engine-0.3.0rc71.dist-info → corvic_engine-0.3.0rc73.dist-info}/licenses/LICENSE +0 -0
corvic/engine/_native.pyd
CHANGED
Binary file
|
corvic/model/_pipeline.py
CHANGED
@@ -293,6 +293,33 @@ class OcrPdfsPipeline(Pipeline):
|
|
293
293
|
op_graph.feature_type.categorical(),
|
294
294
|
),
|
295
295
|
NewColumn("title", pl.String(), op_graph.feature_type.text()),
|
296
|
+
NewColumn(
|
297
|
+
"resource_id",
|
298
|
+
pl.String(),
|
299
|
+
op_graph.feature_type.identifier(),
|
300
|
+
),
|
301
|
+
NewColumn(
|
302
|
+
"page_number",
|
303
|
+
pl.Int64(),
|
304
|
+
op_graph.feature_type.numerical(),
|
305
|
+
),
|
306
|
+
NewColumn(
|
307
|
+
"bbox",
|
308
|
+
pl.Struct(
|
309
|
+
[
|
310
|
+
pl.Field("x1", pl.Float64()),
|
311
|
+
pl.Field("y1", pl.Float64()),
|
312
|
+
pl.Field("x2", pl.Float64()),
|
313
|
+
pl.Field("y2", pl.Float64()),
|
314
|
+
]
|
315
|
+
),
|
316
|
+
op_graph.feature_type.embedding(),
|
317
|
+
),
|
318
|
+
NewColumn(
|
319
|
+
"created_at",
|
320
|
+
pl.Datetime(),
|
321
|
+
op_graph.feature_type.timestamp(),
|
322
|
+
),
|
296
323
|
],
|
297
324
|
)
|
298
325
|
)
|
@@ -360,6 +387,33 @@ class OcrPdfsPipeline(Pipeline):
|
|
360
387
|
pl.String(),
|
361
388
|
op_graph.feature_type.foreign_key(text_source.id),
|
362
389
|
),
|
390
|
+
NewColumn(
|
391
|
+
"resource_id",
|
392
|
+
pl.String(),
|
393
|
+
op_graph.feature_type.identifier(),
|
394
|
+
),
|
395
|
+
NewColumn(
|
396
|
+
"page_number",
|
397
|
+
pl.Int64(),
|
398
|
+
op_graph.feature_type.numerical(),
|
399
|
+
),
|
400
|
+
NewColumn(
|
401
|
+
"bbox",
|
402
|
+
pl.Struct(
|
403
|
+
[
|
404
|
+
pl.Field("x1", pl.Float64()),
|
405
|
+
pl.Field("y1", pl.Float64()),
|
406
|
+
pl.Field("x2", pl.Float64()),
|
407
|
+
pl.Field("y2", pl.Float64()),
|
408
|
+
]
|
409
|
+
),
|
410
|
+
op_graph.feature_type.embedding(),
|
411
|
+
),
|
412
|
+
NewColumn(
|
413
|
+
"created_at",
|
414
|
+
pl.Datetime(),
|
415
|
+
op_graph.feature_type.timestamp(),
|
416
|
+
),
|
363
417
|
],
|
364
418
|
)
|
365
419
|
)
|
@@ -59,6 +59,12 @@ OrmBelongsToOrgObj = TypeVar("OrmBelongsToOrgObj", bound=_OrmBelongsToOrgModel[A
|
|
59
59
|
OrmBelongsToRoomObj = TypeVar("OrmBelongsToRoomObj", bound=_OrmBelongsToRoomModel[Any])
|
60
60
|
|
61
61
|
|
62
|
+
def _orm_id_to_str(id: orm.ID | None):
|
63
|
+
if id:
|
64
|
+
return str(id)
|
65
|
+
return ""
|
66
|
+
|
67
|
+
|
62
68
|
def _translate_orm_id(
|
63
69
|
obj_id: str, id_class: type[ID]
|
64
70
|
) -> Ok[ID | None] | orm.InvalidORMIdentifierError:
|
@@ -88,9 +94,9 @@ def resource_orm_to_proto(resource_orm: orm.Resource) -> models_pb2.Resource:
|
|
88
94
|
pipeline_id = ""
|
89
95
|
if resource_orm.pipeline_ref:
|
90
96
|
pipeline_input_name = resource_orm.pipeline_ref.name
|
91
|
-
pipeline_id =
|
97
|
+
pipeline_id = _orm_id_to_str(resource_orm.pipeline_ref.pipeline_id)
|
92
98
|
return models_pb2.Resource(
|
93
|
-
id=
|
99
|
+
id=_orm_id_to_str(resource_orm.id),
|
94
100
|
name=resource_orm.name,
|
95
101
|
description=resource_orm.description,
|
96
102
|
mime_type=resource_orm.mime_type,
|
@@ -98,8 +104,8 @@ def resource_orm_to_proto(resource_orm: orm.Resource) -> models_pb2.Resource:
|
|
98
104
|
md5=resource_orm.md5,
|
99
105
|
size=resource_orm.size,
|
100
106
|
original_path=resource_orm.original_path,
|
101
|
-
room_id=
|
102
|
-
org_id=
|
107
|
+
room_id=_orm_id_to_str(resource_orm.room_id),
|
108
|
+
org_id=_orm_id_to_str(resource_orm.org_id),
|
103
109
|
recent_events=[resource_orm.latest_event] if resource_orm.latest_event else [],
|
104
110
|
is_terminal=bool(resource_orm.is_terminal),
|
105
111
|
pipeline_id=pipeline_id,
|
@@ -110,12 +116,12 @@ def resource_orm_to_proto(resource_orm: orm.Resource) -> models_pb2.Resource:
|
|
110
116
|
|
111
117
|
def source_orm_to_proto(source_orm: orm.Source) -> models_pb2.Source:
|
112
118
|
return models_pb2.Source(
|
113
|
-
id=
|
119
|
+
id=_orm_id_to_str(source_orm.id),
|
114
120
|
name=source_orm.name,
|
115
121
|
table_op_graph=source_orm.table_op_graph,
|
116
|
-
room_id=
|
117
|
-
org_id=
|
118
|
-
pipeline_id=
|
122
|
+
room_id=_orm_id_to_str(source_orm.room_id),
|
123
|
+
org_id=_orm_id_to_str(source_orm.org_id),
|
124
|
+
pipeline_id=_orm_id_to_str(source_orm.pipeline_ref.pipeline_id)
|
119
125
|
if source_orm.pipeline_ref
|
120
126
|
else "",
|
121
127
|
created_at=timestamp_orm_to_proto(source_orm.created_at),
|
@@ -132,12 +138,12 @@ def feature_view_source_orm_to_proto(
|
|
132
138
|
# with the source's opgraph
|
133
139
|
op = feature_view_source_orm.source.table_op_graph
|
134
140
|
return models_pb2.FeatureViewSource(
|
135
|
-
id=
|
136
|
-
room_id=
|
141
|
+
id=_orm_id_to_str(feature_view_source_orm.id),
|
142
|
+
room_id=_orm_id_to_str(feature_view_source_orm.room_id),
|
137
143
|
source=source_orm_to_proto(feature_view_source_orm.source),
|
138
144
|
table_op_graph=op,
|
139
145
|
drop_disconnected=feature_view_source_orm.drop_disconnected,
|
140
|
-
org_id=
|
146
|
+
org_id=_orm_id_to_str(feature_view_source_orm.org_id),
|
141
147
|
created_at=timestamp_orm_to_proto(feature_view_source_orm.created_at),
|
142
148
|
)
|
143
149
|
|
@@ -146,16 +152,16 @@ def feature_view_orm_to_proto(
|
|
146
152
|
feature_view_orm: orm.FeatureView,
|
147
153
|
) -> models_pb2.FeatureView:
|
148
154
|
return models_pb2.FeatureView(
|
149
|
-
id=
|
155
|
+
id=_orm_id_to_str(feature_view_orm.id),
|
150
156
|
name=feature_view_orm.name,
|
151
157
|
description=feature_view_orm.description,
|
152
|
-
room_id=
|
158
|
+
room_id=_orm_id_to_str(feature_view_orm.room_id),
|
153
159
|
feature_view_output=feature_view_orm.feature_view_output,
|
154
160
|
feature_view_sources=[
|
155
161
|
feature_view_source_orm_to_proto(fvs)
|
156
162
|
for fvs in feature_view_orm.feature_view_sources
|
157
163
|
],
|
158
|
-
org_id=
|
164
|
+
org_id=_orm_id_to_str(feature_view_orm.org_id),
|
159
165
|
created_at=timestamp_orm_to_proto(feature_view_orm.created_at),
|
160
166
|
)
|
161
167
|
|
@@ -164,15 +170,15 @@ def pipeline_orm_to_proto(
|
|
164
170
|
pipeline_orm: orm.Pipeline,
|
165
171
|
) -> models_pb2.Pipeline:
|
166
172
|
return models_pb2.Pipeline(
|
167
|
-
id=
|
173
|
+
id=_orm_id_to_str(pipeline_orm.id),
|
168
174
|
name=pipeline_orm.name,
|
169
|
-
room_id=
|
175
|
+
room_id=_orm_id_to_str(pipeline_orm.room_id),
|
170
176
|
source_outputs={
|
171
177
|
output_obj.name: source_orm_to_proto(output_obj.source)
|
172
178
|
for output_obj in pipeline_orm.outputs
|
173
179
|
},
|
174
180
|
pipeline_transformation=pipeline_orm.transformation,
|
175
|
-
org_id=
|
181
|
+
org_id=_orm_id_to_str(pipeline_orm.org_id),
|
176
182
|
description=pipeline_orm.description,
|
177
183
|
created_at=timestamp_orm_to_proto(pipeline_orm.created_at),
|
178
184
|
)
|
@@ -180,23 +186,23 @@ def pipeline_orm_to_proto(
|
|
180
186
|
|
181
187
|
def space_orm_to_proto(space_orm: orm.Space) -> models_pb2.Space:
|
182
188
|
return models_pb2.Space(
|
183
|
-
id=
|
189
|
+
id=_orm_id_to_str(space_orm.id),
|
184
190
|
name=space_orm.name,
|
185
191
|
description=space_orm.description,
|
186
|
-
room_id=
|
192
|
+
room_id=_orm_id_to_str(space_orm.room_id),
|
187
193
|
space_parameters=space_orm.parameters,
|
188
194
|
feature_view=feature_view_orm_to_proto(space_orm.feature_view),
|
189
195
|
auto_sync=space_orm.auto_sync if space_orm.auto_sync is not None else False,
|
190
|
-
org_id=
|
196
|
+
org_id=_orm_id_to_str(space_orm.org_id),
|
191
197
|
created_at=timestamp_orm_to_proto(space_orm.created_at),
|
192
198
|
)
|
193
199
|
|
194
200
|
|
195
201
|
def room_orm_to_proto(room_orm: orm.Room) -> models_pb2.Room:
|
196
202
|
return models_pb2.Room(
|
197
|
-
id=
|
203
|
+
id=_orm_id_to_str(room_orm.id),
|
198
204
|
name=room_orm.name,
|
199
|
-
org_id=
|
205
|
+
org_id=_orm_id_to_str(room_orm.org_id),
|
200
206
|
created_at=timestamp_orm_to_proto(room_orm.created_at),
|
201
207
|
)
|
202
208
|
|
@@ -205,10 +211,10 @@ def completion_model_orm_to_proto(
|
|
205
211
|
completion_model_orm: orm.CompletionModel,
|
206
212
|
) -> models_pb2.CompletionModel:
|
207
213
|
return models_pb2.CompletionModel(
|
208
|
-
id=
|
214
|
+
id=_orm_id_to_str(completion_model_orm.id),
|
209
215
|
name=completion_model_orm.name,
|
210
216
|
description=completion_model_orm.description,
|
211
|
-
org_id=
|
217
|
+
org_id=_orm_id_to_str(completion_model_orm.org_id),
|
212
218
|
parameters=completion_model_orm.parameters,
|
213
219
|
secret_api_key=completion_model_orm.secret_api_key,
|
214
220
|
created_at=timestamp_orm_to_proto(completion_model_orm.created_at),
|
@@ -432,12 +438,14 @@ def feature_view_proto_to_orm(
|
|
432
438
|
return err
|
433
439
|
session.flush()
|
434
440
|
|
435
|
-
if not orm_obj.id:
|
441
|
+
if not orm_obj.id or not orm_obj.room_id:
|
436
442
|
raise InternalError("internal assertion did not hold")
|
437
443
|
|
438
444
|
new_fv_sources = list[orm.FeatureViewSource]()
|
439
445
|
for fvs in proto_obj.feature_view_sources:
|
440
|
-
match _feature_view_source_proto_to_orm(
|
446
|
+
match _feature_view_source_proto_to_orm(
|
447
|
+
fvs, orm_obj.room_id, orm_obj.id, session
|
448
|
+
):
|
441
449
|
case orm.InvalidORMIdentifierError() | InvalidArgumentError() as err:
|
442
450
|
return err
|
443
451
|
case Ok(fvs_orm):
|
@@ -481,6 +489,7 @@ def feature_view_proto_to_orm(
|
|
481
489
|
|
482
490
|
def _feature_view_source_proto_to_orm(
|
483
491
|
proto_obj: models_pb2.FeatureViewSource,
|
492
|
+
room_id: orm.RoomID,
|
484
493
|
feature_view_id: orm.FeatureViewID,
|
485
494
|
session: sa_orm.Session,
|
486
495
|
) -> Ok[orm.FeatureViewSource] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
@@ -490,6 +499,7 @@ def _feature_view_source_proto_to_orm(
|
|
490
499
|
case Ok(source_id):
|
491
500
|
pass
|
492
501
|
|
502
|
+
proto_obj.room_id = proto_obj.room_id or str(room_id)
|
493
503
|
orm_obj = orm.FeatureViewSource(
|
494
504
|
table_op_graph=proto_obj.table_op_graph,
|
495
505
|
drop_disconnected=proto_obj.drop_disconnected,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
corvic_engine-0.3.
|
2
|
-
corvic_engine-0.3.
|
3
|
-
corvic_engine-0.3.
|
1
|
+
corvic_engine-0.3.0rc73.dist-info/METADATA,sha256=1F9B814nggmD1vYuGX_rvyhtsCtBEICKvJFzdyzrezY,1814
|
2
|
+
corvic_engine-0.3.0rc73.dist-info/WHEEL,sha256=hKPP3BCTWtTwj6SFaSI--T5aOGqh_llYfbZ_BsqivwA,94
|
3
|
+
corvic_engine-0.3.0rc73.dist-info/licenses/LICENSE,sha256=DSS1OD0oIgssKOmAzkMRBv5jvvVuZQbrIv8lpl9DXY8,1035
|
4
4
|
corvic/context/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
corvic/context/__init__.py,sha256=J69SWL27p4euoS3e_Z1K-rqSFRzGdBT3ryuRfM9r9cM,1498
|
6
6
|
corvic/embed/node2vec.py,sha256=Qep1lYMKN4nL4z6Ftylr0pj2aJ2LJmWRmnZV27xYJ-M,11251
|
@@ -19,8 +19,8 @@ corvic/model/_defaults.py,sha256=yoKPPSmYJCE5YAD5jLTEmT4XNf_zXoggNK-uyG8MfVs,152
|
|
19
19
|
corvic/model/_errors.py,sha256=Ctlq04SDwHzJPvLaL1rzqzwVqf2b50EILfW3cH4vnh8,261
|
20
20
|
corvic/model/_feature_type.py,sha256=Y-_-wa9fv7XaCAkxfjjoCLxxK2Ftfba-PMefD7bNXzs,917
|
21
21
|
corvic/model/_feature_view.py,sha256=vRh9eVDlais8enZVymQtwPz8vd3QtwSRYR1CnlKtCnA,49698
|
22
|
-
corvic/model/_pipeline.py,sha256=
|
23
|
-
corvic/model/_proto_orm_convert.py,sha256=
|
22
|
+
corvic/model/_pipeline.py,sha256=X9b34eCTD4zr6IF61EZRLC89n_Fi9HrsukoghDKwhI8,18685
|
23
|
+
corvic/model/_proto_orm_convert.py,sha256=3E4dPZ9sdF_BAT6_SR7YscioG90rb2NnQHqUChelXL8,24014
|
24
24
|
corvic/model/_resource.py,sha256=R973-POS5HDCo7hIoxsBNauH1YAPisZDFLrWIxjygbk,8495
|
25
25
|
corvic/model/_room.py,sha256=36mXngZ38L4mr6_LgUm-QgsUUaoGMiYQRfvXLV_jd-4,2914
|
26
26
|
corvic/model/_source.py,sha256=evgqs_6-IK2dl35EJpcc3rD5yTCUZudcQYL24vLTElg,9785
|
@@ -206,5 +206,5 @@ corvic_generated/status/v1/event_pb2.pyi,sha256=eU-ibrYpvEAJSIDlSa62-bC96AQU1ykF
|
|
206
206
|
corvic_generated/status/v1/event_pb2_grpc.pyi,sha256=H9-ADaiKR9iyVZvmnXutZqWwRRCDxjUIktkfJrJFIHg,417
|
207
207
|
corvic_generated/status/v1/service_pb2.pyi,sha256=iXLR2FOKQJpBgvBzpD2kVwcYOCksP2aRwK4JYaI9CBw,558
|
208
208
|
corvic_generated/status/v1/service_pb2_grpc.pyi,sha256=OoAnaZ64FD0UTzPoRhYvQU8ecoilhHj3ySjSfHbVDaU,1501
|
209
|
-
corvic/engine/_native.pyd,sha256
|
210
|
-
corvic_engine-0.3.
|
209
|
+
corvic/engine/_native.pyd,sha256=-pPjZjUf0XKYtT6C_xZBZgOKQAyffwmHoJFqB8dZVRU,438272
|
210
|
+
corvic_engine-0.3.0rc73.dist-info/RECORD,,
|
File without changes
|
File without changes
|