corvic-engine 0.3.0rc67__tar.gz → 0.3.0rc68__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 (212) hide show
  1. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/Cargo.lock +2 -2
  2. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/Cargo.toml +1 -1
  3. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/PKG-INFO +3 -4
  4. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/README.md +1 -1
  5. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/pyproject.toml +7 -7
  6. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_base_model.py +3 -4
  7. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_completion_model.py +2 -4
  8. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_feature_view.py +5 -6
  9. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_pipeline.py +1 -2
  10. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_resource.py +1 -2
  11. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_source.py +1 -2
  12. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_space.py +1 -2
  13. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/base.py +4 -5
  14. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/ids.py +1 -2
  15. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/mixins.py +6 -8
  16. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/_temporal.py +1 -1
  17. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/result/__init__.py +1 -2
  18. corvic_engine-0.3.0rc68/python/corvic/system/_column_encoding.py +215 -0
  19. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/_embedder.py +24 -2
  20. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/_image_embedder.py +38 -0
  21. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/_planner.py +6 -3
  22. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/_text_embedder.py +21 -0
  23. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/client.py +2 -1
  24. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/in_memory_executor.py +503 -507
  25. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/op_graph_executor.py +7 -3
  26. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/storage.py +1 -3
  27. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/table/table.py +5 -5
  28. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/LICENSE +0 -0
  29. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/Cargo.toml +0 -0
  30. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/buf/validate/validate_pb2.py +0 -0
  31. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/buf/validate/validate_pb2.pyi +0 -0
  32. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/buf/validate/validate_pb2_grpc.py +0 -0
  33. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/buf/validate/validate_pb2_grpc.pyi +0 -0
  34. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/context/__init__.py +0 -0
  35. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/context/py.typed +0 -0
  36. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embed/__init__.py +0 -0
  37. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embed/node2vec.py +0 -0
  38. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embed/py.typed +0 -0
  39. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embedding_metric/__init__.py +0 -0
  40. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embedding_metric/embeddings.py +0 -0
  41. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/embedding_metric/py.typed +0 -0
  42. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/engine/__init__.py +0 -0
  43. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/engine/_native.pyi +0 -0
  44. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/engine/py.typed +0 -0
  45. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/__init__.py +0 -0
  46. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_defaults.py +0 -0
  47. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_errors.py +0 -0
  48. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_feature_type.py +0 -0
  49. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_proto_orm_convert.py +0 -0
  50. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/_room.py +0 -0
  51. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/model/py.typed +0 -0
  52. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/__init__.py +0 -0
  53. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/_schema.py +0 -0
  54. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/_transformations.py +0 -0
  55. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/aggregation.py +0 -0
  56. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/encoders.py +0 -0
  57. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/errors.py +0 -0
  58. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/feature_types.py +0 -0
  59. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/ops.py +0 -0
  60. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/py.typed +0 -0
  61. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/row_filters/__init__.py +0 -0
  62. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/row_filters/_jsonlogic.py +0 -0
  63. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/row_filters/_row_filters.py +0 -0
  64. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/op_graph/sample_strategy.py +0 -0
  65. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/__init__.py +0 -0
  66. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/_proto_columns.py +0 -0
  67. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/errors.py +0 -0
  68. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/func/__init__.py +0 -0
  69. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/func/utc_func.py +0 -0
  70. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/func/uuid_func.py +0 -0
  71. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/keys.py +0 -0
  72. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/orm/py.typed +0 -0
  73. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/__init__.py +0 -0
  74. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/_const.py +0 -0
  75. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/_from_value.py +0 -0
  76. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/_to_value.py +0 -0
  77. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/_types.py +0 -0
  78. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/pa_scalar/py.typed +0 -0
  79. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/proto_wrapper/__init__.py +0 -0
  80. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/proto_wrapper/_errors.py +0 -0
  81. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/proto_wrapper/_wrappers.py +0 -0
  82. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/proto_wrapper/py.typed +0 -0
  83. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/result/py.typed +0 -0
  84. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/sql/__init__.py +0 -0
  85. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/sql/parse_ops.py +0 -0
  86. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/sql/py.typed +0 -0
  87. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/__init__.py +0 -0
  88. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/_dimension_reduction.py +0 -0
  89. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/py.typed +0 -0
  90. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system/staging.py +0 -0
  91. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/__init__.py +0 -0
  92. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/client.py +0 -0
  93. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/fs_blob_store.py +0 -0
  94. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/py.typed +0 -0
  95. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/rdbms_blob_store.py +0 -0
  96. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/system_sqlite/staging.py +0 -0
  97. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/table/__init__.py +0 -0
  98. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/table/py.typed +0 -0
  99. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/version/__init__.py +0 -0
  100. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/version/py.typed +0 -0
  101. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/well_known_types/__init__.py +0 -0
  102. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic/well_known_types/py.typed +0 -0
  103. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/__init__.py +0 -0
  104. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/__init__.py +0 -0
  105. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/__init__.py +0 -0
  106. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/v1/__init__.py +0 -0
  107. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/v1/graph_pb2.py +0 -0
  108. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/v1/graph_pb2.pyi +0 -0
  109. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/v1/graph_pb2_grpc.py +0 -0
  110. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/algorithm/graph/v1/graph_pb2_grpc.pyi +0 -0
  111. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/__init__.py +0 -0
  112. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/v1/__init__.py +0 -0
  113. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/v1/models_pb2.py +0 -0
  114. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/v1/models_pb2.pyi +0 -0
  115. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/v1/models_pb2_grpc.py +0 -0
  116. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/embedding/v1/models_pb2_grpc.pyi +0 -0
  117. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/__init__.py +0 -0
  118. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/__init__.py +0 -0
  119. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/experiment_pb2.py +0 -0
  120. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/experiment_pb2.pyi +0 -0
  121. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/experiment_pb2_grpc.py +0 -0
  122. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/experiment_pb2_grpc.pyi +0 -0
  123. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/space_pb2.py +0 -0
  124. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/space_pb2.pyi +0 -0
  125. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/space_pb2_grpc.py +0 -0
  126. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v1/space_pb2_grpc.pyi +0 -0
  127. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/__init__.py +0 -0
  128. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/feature_view_pb2.py +0 -0
  129. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/feature_view_pb2.pyi +0 -0
  130. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/feature_view_pb2_grpc.py +0 -0
  131. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/feature_view_pb2_grpc.pyi +0 -0
  132. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/space_pb2.py +0 -0
  133. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/space_pb2.pyi +0 -0
  134. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/space_pb2_grpc.py +0 -0
  135. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/feature/v2/space_pb2_grpc.pyi +0 -0
  136. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/__init__.py +0 -0
  137. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v1/__init__.py +0 -0
  138. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v1/service_pb2.py +0 -0
  139. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v1/service_pb2.pyi +0 -0
  140. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v1/service_pb2_grpc.py +0 -0
  141. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v1/service_pb2_grpc.pyi +0 -0
  142. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/__init__.py +0 -0
  143. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/pipeline_pb2.py +0 -0
  144. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/pipeline_pb2.pyi +0 -0
  145. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/pipeline_pb2_grpc.py +0 -0
  146. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/pipeline_pb2_grpc.pyi +0 -0
  147. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/quick_mode_pb2.py +0 -0
  148. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/quick_mode_pb2.pyi +0 -0
  149. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/quick_mode_pb2_grpc.py +0 -0
  150. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/quick_mode_pb2_grpc.pyi +0 -0
  151. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/resource_pb2.py +0 -0
  152. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/resource_pb2.pyi +0 -0
  153. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/resource_pb2_grpc.py +0 -0
  154. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/resource_pb2_grpc.pyi +0 -0
  155. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/room_pb2.py +0 -0
  156. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/room_pb2.pyi +0 -0
  157. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/room_pb2_grpc.py +0 -0
  158. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/room_pb2_grpc.pyi +0 -0
  159. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/source_pb2.py +0 -0
  160. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/source_pb2.pyi +0 -0
  161. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/source_pb2_grpc.py +0 -0
  162. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/source_pb2_grpc.pyi +0 -0
  163. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/table_pb2.py +0 -0
  164. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/table_pb2.pyi +0 -0
  165. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/table_pb2_grpc.py +0 -0
  166. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/ingest/v2/table_pb2_grpc.pyi +0 -0
  167. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/__init__.py +0 -0
  168. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/v1alpha/__init__.py +0 -0
  169. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/v1alpha/models_pb2.py +0 -0
  170. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/v1alpha/models_pb2.pyi +0 -0
  171. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/v1alpha/models_pb2_grpc.py +0 -0
  172. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/model/v1alpha/models_pb2_grpc.pyi +0 -0
  173. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/__init__.py +0 -0
  174. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/__init__.py +0 -0
  175. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/agent_pb2.py +0 -0
  176. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/agent_pb2.pyi +0 -0
  177. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/agent_pb2_grpc.py +0 -0
  178. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/agent_pb2_grpc.pyi +0 -0
  179. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/common_pb2.py +0 -0
  180. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/common_pb2.pyi +0 -0
  181. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/common_pb2_grpc.py +0 -0
  182. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/common_pb2_grpc.pyi +0 -0
  183. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/completion_model_pb2.py +0 -0
  184. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/completion_model_pb2.pyi +0 -0
  185. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/completion_model_pb2_grpc.py +0 -0
  186. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/completion_model_pb2_grpc.pyi +0 -0
  187. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/feature_view_pb2.py +0 -0
  188. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/feature_view_pb2.pyi +0 -0
  189. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/feature_view_pb2_grpc.py +0 -0
  190. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/feature_view_pb2_grpc.pyi +0 -0
  191. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/pipeline_pb2.py +0 -0
  192. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/pipeline_pb2.pyi +0 -0
  193. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/pipeline_pb2_grpc.py +0 -0
  194. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/pipeline_pb2_grpc.pyi +0 -0
  195. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/space_pb2.py +0 -0
  196. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/space_pb2.pyi +0 -0
  197. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/space_pb2_grpc.py +0 -0
  198. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/space_pb2_grpc.pyi +0 -0
  199. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/table_pb2.py +0 -0
  200. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/table_pb2.pyi +0 -0
  201. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/table_pb2_grpc.py +0 -0
  202. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/orm/v1/table_pb2_grpc.pyi +0 -0
  203. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/__init__.py +0 -0
  204. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/__init__.py +0 -0
  205. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/event_pb2.py +0 -0
  206. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/event_pb2.pyi +0 -0
  207. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/event_pb2_grpc.py +0 -0
  208. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/event_pb2_grpc.pyi +0 -0
  209. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/service_pb2.py +0 -0
  210. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/service_pb2.pyi +0 -0
  211. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/service_pb2_grpc.py +0 -0
  212. {corvic_engine-0.3.0rc67 → corvic_engine-0.3.0rc68}/python/corvic_generated/status/v1/service_pb2_grpc.pyi +0 -0
@@ -16,7 +16,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
16
16
 
17
17
  [[package]]
18
18
  name = "corvic-engine"
19
- version = "0.3.0-rc.67"
19
+ version = "0.3.0-rc.68"
20
20
  dependencies = [
21
21
  "numpy",
22
22
  "pyo3",
@@ -57,7 +57,7 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
57
57
 
58
58
  [[package]]
59
59
  name = "engine-walk"
60
- version = "0.3.0-rc.67"
60
+ version = "0.3.0-rc.68"
61
61
  dependencies = [
62
62
  "version_check",
63
63
  ]
@@ -3,7 +3,7 @@ resolver = "2"
3
3
  members = ["python"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.3.0-rc.67"
6
+ version = "0.3.0-rc.68"
7
7
  edition = "2021"
8
8
  publish = false
9
9
 
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corvic-engine
3
- Version: 0.3.0rc67
3
+ Version: 0.3.0rc68
4
4
  Classifier: Environment :: Console
5
5
  Classifier: License :: Other/Proprietary License
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
7
7
  Classifier: Programming Language :: Python :: Implementation :: PyPy
8
- Classifier: Programming Language :: Python :: 3.10
9
8
  Classifier: Programming Language :: Python :: 3.11
10
9
  Classifier: Programming Language :: Python :: 3.12
11
10
  Classifier: Programming Language :: Python :: 3.13
@@ -35,8 +34,8 @@ Provides-Extra: telemetry
35
34
  License-File: LICENSE
36
35
  Summary: Seamless embedding generation and retrieval.
37
36
  Author-email: Corvic Team <contact@corvic.ai>
38
- Requires-Python: >=3.10
37
+ Requires-Python: >=3.11
39
38
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
40
39
 
41
- # Corvic Engine [![CI](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml/badge.svg)](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml) [![Python Version](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12-blue)](https://www.python.org/downloads/release/python-3110/)
40
+ # Corvic Engine [![CI](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml/badge.svg)](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml) [![Python Version](https://img.shields.io/badge/python-3.11%20|%203.12-blue)](https://www.python.org/downloads/release/python-3110/)
42
41
 
@@ -1 +1 @@
1
- # Corvic Engine [![CI](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml/badge.svg)](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml) [![Python Version](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12-blue)](https://www.python.org/downloads/release/python-3110/)
1
+ # Corvic Engine [![CI](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml/badge.svg)](https://github.com/corvicai/corvic-engine/actions/workflows/ci.yaml) [![Python Version](https://img.shields.io/badge/python-3.11%20|%203.12-blue)](https://www.python.org/downloads/release/python-3110/)
@@ -1,12 +1,11 @@
1
1
  [project]
2
2
  name = "corvic-engine"
3
- requires-python = ">=3.10"
3
+ requires-python = ">=3.11"
4
4
  classifiers = [
5
5
  "Environment :: Console",
6
6
  "License :: Other/Proprietary License",
7
7
  "Programming Language :: Python :: Implementation :: CPython",
8
8
  "Programming Language :: Python :: Implementation :: PyPy",
9
- "Programming Language :: Python :: 3.10",
10
9
  "Programming Language :: Python :: 3.11",
11
10
  "Programming Language :: Python :: 3.12",
12
11
  "Programming Language :: Python :: 3.13",
@@ -20,7 +19,7 @@ authors = [
20
19
  ]
21
20
  readme = "README.md"
22
21
  description = "Seamless embedding generation and retrieval."
23
- version = "0.3.0-rc.67" # sync this with tool.poetry.version below
22
+ version = "0.3.0-rc.68" # sync this with tool.poetry.version below
24
23
 
25
24
  # TODO(ddn): Pull dependencies from tool.poetry.dependencies. We use maturin as
26
25
  # the build system but poetry for the development environment.
@@ -74,7 +73,7 @@ packages = [
74
73
  ]
75
74
  description = ""
76
75
  authors = []
77
- version = "0.3.0-rc.67"
76
+ version = "0.3.0-rc.68"
78
77
 
79
78
  [tool.poetry.scripts]
80
79
  check = "corvic_check.cli:main"
@@ -102,7 +101,7 @@ protobuf = ">=4.25.0,<4.25.4"
102
101
  protovalidate = "^0.7.1"
103
102
  pyarrow = "^17"
104
103
  # Should match build matrix for any native code dependencies (namely pyarrow)
105
- python = ">=3.10,<3.13"
104
+ python = ">=3.11,<3.13"
106
105
  sqlalchemy = "^2.0.27"
107
106
  # Rust tokenizer for better performances
108
107
  sqlglot = { extras = ["rs"], version = "^25.8.1" }
@@ -112,6 +111,7 @@ types-cachetools = "^5.3.0"
112
111
  typing-extensions = "^4.9.0"
113
112
 
114
113
  [tool.poetry.group.dev.dependencies]
114
+ anyio = "^4"
115
115
  click = "^8.1.7"
116
116
  click_default_group = "^1.2.4"
117
117
  codespell = "^2.2.6"
@@ -123,12 +123,12 @@ pdoc = "^14.5.1"
123
123
  pre-commit = "^4.0.0"
124
124
  pyright = "^1.1.387"
125
125
  pytest = "^8.1.1"
126
+ pytest-asyncio = "^0.26"
126
127
  pytest-benchmark = "^4.0.0"
127
128
  pytest-fail-slow = "^0.6.0"
128
129
  pytest-socket = "^0.7.0"
129
130
  pytest-timeout = "^2.2.0"
130
131
  ruff = "^0.6.9"
131
- tomli = "^2.0.1" # would use tomllib but is not available in 3.10
132
132
  hypothesis = "^6.102.4"
133
133
  yq = "^3.4.3" # includes xq for parsing xml test results
134
134
 
@@ -377,7 +377,7 @@ testpaths = [
377
377
  # The slow threshold should be less than the timeout threshold.
378
378
  timeout = 60
379
379
  # pytest-socket
380
- addopts = "--disable-socket"
380
+ addopts = "--disable-socket --allow-unix-socket --allow-hosts=127.0.0.1,localhost,[::1]"
381
381
 
382
382
  [tool.coverage.run]
383
383
  branch = true
@@ -5,12 +5,11 @@ import datetime
5
5
  import functools
6
6
  import uuid
7
7
  from collections.abc import Callable, Iterable, Iterator, Sequence
8
- from typing import Final, Generic
8
+ from typing import Final, Generic, Self
9
9
 
10
10
  import sqlalchemy as sa
11
11
  import sqlalchemy.orm as sa_orm
12
12
  import structlog
13
- from typing_extensions import Self
14
13
 
15
14
  from corvic import orm, system
16
15
  from corvic.model._proto_orm_convert import (
@@ -54,7 +53,7 @@ class HasProtoSelf(Generic[ProtoObj], abc.ABC):
54
53
  @property
55
54
  def created_at(self) -> datetime.datetime | None:
56
55
  if self.proto_self.created_at:
57
- return self.proto_self.created_at.ToDatetime(tzinfo=datetime.timezone.utc)
56
+ return self.proto_self.created_at.ToDatetime(tzinfo=datetime.UTC)
58
57
  return None
59
58
 
60
59
 
@@ -119,7 +118,7 @@ class BaseModel(Generic[ID, ProtoObj, OrmObj], UsesOrmID[ID, ProtoObj]):
119
118
  while True:
120
119
  try:
121
120
  yield from it
122
- except Exception: # noqa: PERF203
121
+ except Exception:
123
122
  _logger.exception(
124
123
  "omitting source from list: "
125
124
  + "failed to parse source from database entry",
@@ -116,16 +116,14 @@ class CompletionModel(
116
116
  @property
117
117
  def last_validation_time(self) -> datetime.datetime | None:
118
118
  if self.proto_self.last_validation_time != UNIX_TIMESTAMP_START_DATETIME:
119
- return self.proto_self.last_validation_time.ToDatetime(
120
- tzinfo=datetime.timezone.utc
121
- )
119
+ return self.proto_self.last_validation_time.ToDatetime(tzinfo=datetime.UTC)
122
120
  return None
123
121
 
124
122
  @property
125
123
  def last_successful_validation(self) -> datetime.datetime | None:
126
124
  if self.proto_self.last_successful_validation != UNIX_TIMESTAMP_START_DATETIME:
127
125
  return self.proto_self.last_successful_validation.ToDatetime(
128
- tzinfo=datetime.timezone.utc
126
+ tzinfo=datetime.UTC
129
127
  )
130
128
  return None
131
129
 
@@ -7,15 +7,14 @@ import dataclasses
7
7
  import datetime
8
8
  import functools
9
9
  import uuid
10
- from collections.abc import Iterable, Mapping, MutableMapping, Sequence
11
- from typing import Any, Final, TypeAlias
10
+ from collections.abc import AsyncIterable, Iterable, Mapping, MutableMapping, Sequence
11
+ from typing import Any, Final, Self, TypeAlias
12
12
 
13
13
  import pyarrow as pa
14
14
  from google.protobuf import struct_pb2
15
15
  from more_itertools import flatten
16
16
  from sqlalchemy import orm as sa_orm
17
17
  from sqlalchemy.orm.interfaces import LoaderOption
18
- from typing_extensions import Self
19
18
 
20
19
  from corvic import op_graph, orm, system
21
20
  from corvic.model._base_model import BelongsToRoomModel, UsesOrmID
@@ -324,7 +323,7 @@ class Relationship:
324
323
  how="inner",
325
324
  )
326
325
 
327
- def edge_list(self) -> Iterable[tuple[Any, Any]]:
326
+ async def edge_list(self) -> AsyncIterable[tuple[Any, Any]]:
328
327
  start_pk = self.start_fv_source.table.schema.get_primary_key()
329
328
  end_pk = self.end_fv_source.table.schema.get_primary_key()
330
329
 
@@ -340,8 +339,8 @@ class Relationship:
340
339
 
341
340
  result = self.joined_table().select(result_columns)
342
341
 
343
- for batch in result.to_polars(
344
- room_id=self.start_source.room_id
342
+ for batch in (
343
+ await result.to_polars(room_id=self.start_source.room_id)
345
344
  ).unwrap_or_raise():
346
345
  for row in batch.rows(named=True):
347
346
  yield (row[result_columns[0]], row[result_columns[1]])
@@ -6,12 +6,11 @@ import datetime
6
6
  import functools
7
7
  import uuid
8
8
  from collections.abc import Iterable, Mapping, Sequence
9
- from typing import TypeAlias, cast
9
+ from typing import Self, TypeAlias, cast
10
10
 
11
11
  import polars as pl
12
12
  from sqlalchemy import orm as sa_orm
13
13
  from sqlalchemy.orm.interfaces import LoaderOption
14
- from typing_extensions import Self
15
14
 
16
15
  import corvic.table
17
16
  from corvic import op_graph, orm, system
@@ -6,13 +6,12 @@ import copy
6
6
  import datetime
7
7
  import uuid
8
8
  from collections.abc import Iterable, Sequence
9
- from typing import TypeAlias
9
+ from typing import Self, TypeAlias
10
10
 
11
11
  import polars as pl
12
12
  import sqlalchemy as sa
13
13
  from sqlalchemy import orm as sa_orm
14
14
  from sqlalchemy.orm.interfaces import LoaderOption
15
- from typing_extensions import Self
16
15
 
17
16
  from corvic import orm, system
18
17
  from corvic.model._base_model import BelongsToRoomModel
@@ -6,13 +6,12 @@ import copy
6
6
  import datetime
7
7
  import functools
8
8
  from collections.abc import Iterable, Mapping, Sequence
9
- from typing import TypeAlias
9
+ from typing import Self, TypeAlias
10
10
 
11
11
  import polars as pl
12
12
  import sqlalchemy as sa
13
13
  import sqlalchemy.orm as sa_orm
14
14
  from sqlalchemy.orm.interfaces import LoaderOption
15
- from typing_extensions import Self
16
15
 
17
16
  from corvic import op_graph, orm, system
18
17
  from corvic.model._base_model import BelongsToRoomModel
@@ -6,12 +6,11 @@ import abc
6
6
  import datetime
7
7
  import uuid
8
8
  from collections.abc import Iterable, Mapping, Sequence
9
- from typing import Final, Literal, TypeAlias
9
+ from typing import Final, Literal, Self, TypeAlias
10
10
 
11
11
  import pyarrow as pa
12
12
  import sqlalchemy as sa
13
13
  from sqlalchemy import orm as sa_orm
14
- from typing_extensions import Self
15
14
 
16
15
  from corvic import op_graph, orm, system
17
16
  from corvic.model._base_model import BelongsToRoomModel
@@ -3,14 +3,13 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import uuid
6
- from datetime import datetime, timezone
7
- from typing import Any, ClassVar, Protocol, runtime_checkable
6
+ from datetime import UTC, datetime
7
+ from typing import Any, ClassVar, Protocol, Self, runtime_checkable
8
8
 
9
9
  import sqlalchemy as sa
10
10
  import sqlalchemy.orm as sa_orm
11
11
  from google.protobuf import timestamp_pb2
12
12
  from sqlalchemy.ext import hybrid
13
- from typing_extensions import Self
14
13
 
15
14
  from corvic.orm._proto_columns import ProtoMessageDecorator
16
15
  from corvic.orm.func import utc_now
@@ -151,7 +150,7 @@ class Base(sa_orm.MappedAsDataclass, sa_orm.DeclarativeBase):
151
150
  def created_at(self) -> datetime | None:
152
151
  if not self._created_at:
153
152
  return None
154
- return self._created_at.replace(tzinfo=timezone.utc)
153
+ return self._created_at.replace(tzinfo=UTC)
155
154
 
156
155
  @created_at.inplace.expression
157
156
  @classmethod
@@ -162,7 +161,7 @@ class Base(sa_orm.MappedAsDataclass, sa_orm.DeclarativeBase):
162
161
  def updated_at(self) -> datetime | None:
163
162
  if not self._updated_at:
164
163
  return None
165
- return self._updated_at.replace(tzinfo=timezone.utc)
164
+ return self._updated_at.replace(tzinfo=UTC)
166
165
 
167
166
  @updated_at.inplace.expression
168
167
  @classmethod
@@ -3,11 +3,10 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import abc
6
- from typing import Any, Generic, TypeVar
6
+ from typing import Any, Generic, Self, TypeVar
7
7
 
8
8
  import sqlalchemy as sa
9
9
  import sqlalchemy.types as sa_types
10
- from typing_extensions import Self
11
10
 
12
11
  import corvic.context
13
12
  from corvic.orm.errors import InvalidORMIdentifierError
@@ -3,8 +3,8 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from collections.abc import Callable, Sequence
6
- from datetime import datetime, timezone
7
- from typing import Any, cast
6
+ from datetime import UTC, datetime
7
+ from typing import Any, LiteralString, cast
8
8
 
9
9
  import sqlalchemy as sa
10
10
  from google.protobuf import timestamp_pb2
@@ -12,7 +12,6 @@ from sqlalchemy import event, exc
12
12
  from sqlalchemy import orm as sa_orm
13
13
  from sqlalchemy.ext import hybrid
14
14
  from sqlalchemy.ext.hybrid import hybrid_property
15
- from typing_extensions import LiteralString
16
15
 
17
16
  import corvic.context
18
17
  from corvic.orm.base import EventBase, EventKey, OrgBase
@@ -137,7 +136,7 @@ class SoftDeleteMixin(sa_orm.MappedAsDataclass):
137
136
  def deleted_at(self) -> datetime | None:
138
137
  if not self._deleted_at:
139
138
  return None
140
- return self._deleted_at.replace(tzinfo=timezone.utc)
139
+ return self._deleted_at.replace(tzinfo=UTC)
141
140
 
142
141
  def reset_delete(self):
143
142
  self._deleted_at = None
@@ -170,7 +169,7 @@ class SoftDeleteMixin(sa_orm.MappedAsDataclass):
170
169
  # set is_live to None instead of False so that orm objects can use it to
171
170
  # build uniqueness constraints that are only enforced on non-deleted objects
172
171
  self.is_live = None
173
- self._deleted_at = datetime.now(tz=timezone.utc)
172
+ self._deleted_at = datetime.now(tz=UTC)
174
173
 
175
174
  @hybrid_property
176
175
  def is_deleted(self) -> bool:
@@ -343,7 +342,7 @@ class Session(sa_orm.Session):
343
342
  def _timestamp_or_utc_now(timestamp: datetime | None = None):
344
343
  if timestamp is not None:
345
344
  return timestamp
346
- return datetime.now(tz=timezone.utc)
345
+ return datetime.now(tz=UTC)
347
346
 
348
347
 
349
348
  class EventLoggerMixin(sa_orm.MappedAsDataclass):
@@ -383,12 +382,11 @@ class EventLoggerMixin(sa_orm.MappedAsDataclass):
383
382
  # this can occur when an event is set on a new object
384
383
  if not self._event_src_id:
385
384
  obj_session.flush()
386
- from datetime import timezone
387
385
 
388
386
  obj_session.add(
389
387
  EventBase(
390
388
  event=event.event_type,
391
- timestamp=event.timestamp.ToDatetime(tzinfo=timezone.utc),
389
+ timestamp=event.timestamp.ToDatetime(tzinfo=UTC),
392
390
  regarding=event.regarding,
393
391
  reason=event.reason,
394
392
  event_key=str(self.event_key),
@@ -86,7 +86,7 @@ def datetime_fromisoformat(s: str) -> datetime.datetime:
86
86
 
87
87
  tzinfo = None
88
88
  if m.group("utc"):
89
- tzinfo = datetime.timezone.utc
89
+ tzinfo = datetime.UTC
90
90
 
91
91
  tz_hour = m.group("tz_hour")
92
92
  if tz_hour:
@@ -55,12 +55,11 @@ from typing import (
55
55
  Literal,
56
56
  NoReturn,
57
57
  ParamSpec,
58
+ Self,
58
59
  TypeVar,
59
60
  overload,
60
61
  )
61
62
 
62
- from typing_extensions import Self
63
-
64
63
  from corvic.well_known_types import JSONAble, JSONExpressable, to_json
65
64
 
66
65
  T_co = TypeVar("T_co", covariant=True)
@@ -0,0 +1,215 @@
1
+ import math
2
+ from typing import Final, cast
3
+
4
+ import numpy as np
5
+ import polars as pl
6
+ import structlog
7
+
8
+ REFERENCE_YEAR: Final = 1900
9
+ """Reference year for normalizing year in Datetime encoder"""
10
+
11
+ MAX_NUMBER_OF_YEARS: Final = 200
12
+ """Maximum number of years for normalizing year in Datetime encoder"""
13
+
14
+ _logger = structlog.get_logger()
15
+
16
+
17
+ def encode_one_hot(to_encode: pl.Series) -> tuple[pl.Series, list[str]]:
18
+ encoded = to_encode.to_dummies()
19
+ return (
20
+ encoded.select(
21
+ pl.concat_list(pl.all()).alias("val").cast(pl.List(pl.Boolean))
22
+ ).to_series(),
23
+ encoded.columns,
24
+ )
25
+
26
+
27
+ def encode_min_max_scale(
28
+ to_encode: pl.Series, range_min: float, range_max: float
29
+ ) -> pl.Series:
30
+ from sklearn.preprocessing import MinMaxScaler
31
+
32
+ encoder = MinMaxScaler(
33
+ feature_range=(
34
+ range_min,
35
+ range_max,
36
+ )
37
+ )
38
+ return pl.Series(
39
+ encoder.fit_transform(to_encode.to_numpy().reshape(-1, 1)).flatten()
40
+ )
41
+
42
+
43
+ def encode_label_boolean(
44
+ to_encode: pl.Series, neg_label: int, pos_label: int
45
+ ) -> pl.Series:
46
+ from sklearn.preprocessing import LabelBinarizer
47
+
48
+ encoder = LabelBinarizer(
49
+ neg_label=neg_label,
50
+ pos_label=pos_label,
51
+ )
52
+ return pl.Series(encoder.fit_transform(to_encode.to_numpy().reshape(-1)))
53
+
54
+
55
+ def encode_label(to_encode: pl.Series, *, normalize: bool) -> pl.Series:
56
+ from sklearn.preprocessing import LabelEncoder
57
+
58
+ encoder = LabelEncoder()
59
+ encoded = encoder.fit_transform(to_encode.to_numpy().reshape(-1)).flatten()
60
+ # `classes_` is only set after fit,
61
+ # Creating custom typestubs will not solve this typing issue.
62
+ if normalize and hasattr(encoder, "classes_"):
63
+ classes_ = cast(list[int], encoder.classes_) # pyright: ignore[reportAttributeAccessIssue, reportUnknownMemberType]
64
+ max_class: int = len(classes_) - 1
65
+ if max_class > 0:
66
+ encoded = encoded.astype(np.float64)
67
+ encoded /= max_class
68
+
69
+ return pl.Series(encoded)
70
+
71
+
72
+ def encode_kbins(
73
+ to_encode: pl.Series, n_bins: int, method: str, strategy: str
74
+ ) -> pl.Series:
75
+ from sklearn.preprocessing import KBinsDiscretizer
76
+
77
+ encoder = KBinsDiscretizer(
78
+ n_bins=n_bins,
79
+ encode=method,
80
+ strategy=strategy,
81
+ dtype=np.float32,
82
+ )
83
+ return pl.Series(
84
+ encoder.fit_transform(to_encode.to_numpy().reshape(-1, 1)).flatten()
85
+ )
86
+
87
+
88
+ def encode_boolean(to_encode: pl.Series, threshold: float) -> pl.Series:
89
+ from sklearn.preprocessing import Binarizer
90
+
91
+ encoder = Binarizer(
92
+ threshold=threshold,
93
+ )
94
+ return pl.Series(
95
+ encoder.fit_transform(to_encode.to_numpy().reshape(-1, 1)).flatten()
96
+ )
97
+
98
+
99
+ def encode_max_abs_scale(to_encode: pl.Series) -> pl.Series:
100
+ from sklearn.preprocessing import MaxAbsScaler
101
+
102
+ encoder = MaxAbsScaler()
103
+ try:
104
+ encoded = encoder.fit_transform(
105
+ np.nan_to_num(to_encode.to_numpy()).reshape(-1, 1)
106
+ ).flatten()
107
+ except ValueError:
108
+ encoded = np.array([])
109
+
110
+ return pl.Series(encoded)
111
+
112
+
113
+ def encode_standard_scale(
114
+ to_encode: pl.Series, *, with_mean: bool, with_std: bool
115
+ ) -> pl.Series:
116
+ from sklearn.preprocessing import StandardScaler
117
+
118
+ encoder = StandardScaler(
119
+ with_mean=with_mean,
120
+ with_std=with_std,
121
+ )
122
+ return pl.Series(
123
+ encoder.fit_transform(to_encode.to_numpy().reshape(-1, 1)).flatten()
124
+ )
125
+
126
+
127
+ def encode_duration(to_encode: pl.Series) -> pl.Series:
128
+ if to_encode.dtype != pl.Duration:
129
+ raise ValueError("Invalid arguments, expected a duration series")
130
+ if to_encode.is_null().all():
131
+ return pl.zeros(len(to_encode), dtype=pl.Float32, eager=True)
132
+
133
+ return to_encode.dt.total_seconds().cast(pl.Float32).fill_null(0.0)
134
+
135
+
136
+ def _get_cyclic_encoding(
137
+ to_encode: pl.Series,
138
+ period: int,
139
+ ) -> tuple[pl.Series, pl.Series]:
140
+ sine_series = (
141
+ (2 * math.pi * to_encode / period).sin().alias(f"{to_encode.name}_sine")
142
+ )
143
+ cosine_series = (
144
+ (2 * math.pi * to_encode / period).cos().alias(f"{to_encode.name}_cosine")
145
+ )
146
+ return sine_series, cosine_series
147
+
148
+
149
+ def encode_datetime(to_encode: pl.Series) -> pl.Series:
150
+ match to_encode.dtype:
151
+ case pl.Date | pl.Time:
152
+ pass
153
+ case pl.Datetime:
154
+ to_encode = to_encode.dt.replace_time_zone("UTC")
155
+ case _:
156
+ raise ValueError(
157
+ "Invalid arguments column could not be endoded as datetime"
158
+ )
159
+
160
+ if to_encode.is_null().all():
161
+ zero_vector = pl.zeros(11, dtype=pl.Float32, eager=True)
162
+ return pl.Series([zero_vector] * len(to_encode), dtype=pl.List(pl.Float32))
163
+
164
+ n = len(to_encode)
165
+ year_norm = pl.zeros(n, dtype=pl.Float32, eager=True).alias("year")
166
+ month_sine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("month_sine")
167
+ month_cosine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("month_cosine")
168
+ day_sine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("day_sine")
169
+ day_cosine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("day_cosine")
170
+ hour_sine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("hour_sine")
171
+ hour_cosine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("hour_cosine")
172
+ minute_sine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("minute_sine")
173
+ minute_cosine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("minute_cosine")
174
+ second_sine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("second_sine")
175
+ second_cosine = pl.zeros(n, dtype=pl.Float32, eager=True).alias("second_cosine")
176
+
177
+ if to_encode.dtype in [pl.Date, pl.Datetime]:
178
+ try:
179
+ year = to_encode.dt.year().cast(pl.Float32).alias("year")
180
+ month = to_encode.dt.month().cast(pl.Float32).alias("month")
181
+ day = to_encode.dt.day().cast(pl.Float32).alias("day")
182
+
183
+ year_norm = (year - REFERENCE_YEAR) / MAX_NUMBER_OF_YEARS
184
+ month_sine, month_cosine = _get_cyclic_encoding(month, 12)
185
+ day_sine, day_cosine = _get_cyclic_encoding(day, 31)
186
+ except pl.exceptions.PanicException as e:
187
+ _logger.exception("Error extracting datetime", exc_info=e)
188
+
189
+ if to_encode.dtype in [pl.Time, pl.Datetime]:
190
+ try:
191
+ hour = to_encode.dt.hour().cast(pl.Float32).alias("hour")
192
+ minute = to_encode.dt.minute().cast(pl.Float32).alias("minute")
193
+ second = to_encode.dt.second().cast(pl.Float32).alias("second")
194
+
195
+ hour_sine, hour_cosine = _get_cyclic_encoding(hour, 24)
196
+ minute_sine, minute_cosine = _get_cyclic_encoding(minute, 60)
197
+ second_sine, second_cosine = _get_cyclic_encoding(second, 60)
198
+ except pl.exceptions.PanicException as e:
199
+ _logger.exception("Error extracting datetime", exc_info=e)
200
+
201
+ return pl.DataFrame(
202
+ [
203
+ year_norm.fill_null(0.0),
204
+ month_sine.fill_null(0.0),
205
+ month_cosine.fill_null(0.0),
206
+ day_sine.fill_null(0.0),
207
+ day_cosine.fill_null(0.0),
208
+ hour_sine.fill_null(0.0),
209
+ hour_cosine.fill_null(0.0),
210
+ minute_sine.fill_null(0.0),
211
+ minute_cosine.fill_null(0.0),
212
+ second_sine.fill_null(0.0),
213
+ second_cosine.fill_null(0.0),
214
+ ]
215
+ ).select(pl.concat_list(pl.all()).alias(to_encode.name))[to_encode.name]