1313# limitations under the License.
1414
1515
16+ from objectbox .logger import logger
1617from objectbox .model .entity import _Entity
1718from objectbox .model .properties import *
1819from objectbox .c import *
19- import logging
2020
2121
2222class IdUid :
@@ -50,11 +50,12 @@ def _set_hnsw_params(self, index: HnswIndex):
5050 if index .distance_type is not None :
5151 obx_model_property_index_hnsw_distance_type (self ._c_model , index .distance_type )
5252 if index .reparation_backlink_probability is not None :
53- obx_model_property_index_hnsw_reparation_backlink_probability (self ._c_model , index .reparation_backlink_probability )
53+ obx_model_property_index_hnsw_reparation_backlink_probability (self ._c_model ,
54+ index .reparation_backlink_probability )
5455 if index .vector_cache_hint_size_kb is not None :
5556 obx_model_property_index_hnsw_vector_cache_hint_size_kb (self ._c_model , index .vector_cache_hint_size_kb )
5657
57- def entity (self , entity : _Entity , last_property_id : IdUid , last_index_id : Optional [ IdUid ] = None ):
58+ def entity (self , entity : _Entity , last_property_id : IdUid ):
5859 if not isinstance (entity , _Entity ):
5960 raise Exception ("Given type is not an Entity. Are you passing an instance instead of a type or did you "
6061 "forget the '@Entity' annotation?" )
@@ -63,12 +64,12 @@ def entity(self, entity: _Entity, last_property_id: IdUid, last_index_id: Option
6364
6465 obx_model_entity (self ._c_model , c_str (entity .name ), entity .id , entity .uid )
6566
66- logging .debug (f"Creating entity \" { entity .name } \" (ID={ entity .id } , { entity .uid } )" )
67+ logger .debug (f"Creating entity \" { entity .name } \" (ID={ entity .id } , { entity .uid } )" )
6768
6869 for property_ in entity .properties :
6970 obx_model_property (self ._c_model , c_str (property_ ._name ), property_ ._ob_type , property_ ._id , property_ ._uid )
7071
71- logging .debug (f"Creating property \" \" (ID={ property_ ._id } , UID={ property_ ._uid } )" )
72+ logger .debug (f"Creating property \" { property_ . _name } \" (ID={ property_ ._id } , UID={ property_ ._uid } )" )
7273
7374 if property_ ._flags != 0 :
7475 obx_model_property_flags (self ._c_model , property_ ._flags )
@@ -77,9 +78,9 @@ def entity(self, entity: _Entity, last_property_id: IdUid, last_index_id: Option
7778 index = property_ ._index
7879 if isinstance (index , HnswIndex ):
7980 self ._set_hnsw_params (index )
80- logging .debug (f" HNSW index (ID={ index .id } , UID{ index .uid } ); Dimensions: { index .dimensions } " )
81+ logger .debug (f" HNSW index (ID={ index .id } , UID{ index .uid } ); Dimensions: { index .dimensions } " )
8182 else :
82- logging .debug (f" Index (ID={ index .id } , UID{ index .uid } ); Type: { index .type } " )
83+ logger .debug (f" Index (ID={ index .id } , UID{ index .uid } ); Type: { index .type } " )
8384 obx_model_property_index_id (self ._c_model , index .id , index .uid )
8485
8586 obx_model_entity_last_property_id (self ._c_model , last_property_id .id , last_property_id .uid )
0 commit comments