fix: make all entity_values unique by appending row index to support bulk_create with ignore_conflicts
This commit is contained in:
+2
-4
@@ -986,10 +986,8 @@ def _run_clustering_pipeline(run, store, entity_ds_id, feature_columns, algorith
|
||||
profiles = []
|
||||
cr_cache = {}
|
||||
for i, row in enumerate(df_umap.iter_rows(named=True)):
|
||||
ev = str(row.get(ent_col, '')) or f'entity_{i}'
|
||||
# Ensure uniqueness by appending row index when using fallback
|
||||
if not row.get(ent_col, ''):
|
||||
ev = f'{ev}_{i}'
|
||||
ev = str(row.get(ent_col, '')) or 'entity'
|
||||
ev = f'{ev}_{i}'
|
||||
lbl = labels_list[i] if i < len(labels_list) else -1
|
||||
cache_key = f'{run.id}_{lbl}'
|
||||
if cache_key not in cr_cache:
|
||||
|
||||
Reference in New Issue
Block a user