nucliadb 6.3.4.post3740__py3-none-any.whl → 6.3.4.post3762__py3-none-any.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.
@@ -314,7 +314,7 @@ class Processor:
314
314
  # index message
315
315
 
316
316
  if resource:
317
- if message.reindex:
317
+ if any(needs_reindex(m) for m in messages):
318
318
  # when reindexing, let's just generate full new index message
319
319
  # TODO - This should be improved in the future as it's not optimal for very large resources:
320
320
  # As of now, there are some API operations that require fully reindexing all the fields of a resource.
@@ -759,3 +759,26 @@ def has_vectors_operation(index_message: PBBrainResource) -> bool:
759
759
  if len(vectorset_sentences.sentences) > 0:
760
760
  return True
761
761
  return False
762
+
763
+
764
+ def needs_reindex(bm: writer_pb2.BrokerMessage) -> bool:
765
+ return bm.reindex or is_vectorset_migration_bm(bm)
766
+
767
+
768
+ def is_vectorset_migration_bm(bm: writer_pb2.BrokerMessage) -> bool:
769
+ """
770
+ This is a temporary solution to avoid duplicating paragraphs and text fields during vector migrations.
771
+ We need to reindex all the fields of a resource to avoid this issue.
772
+ TODO: Remove this when the index message generation logic has been decoupled into its own method.
773
+
774
+ Broker messages from semantic model migration task only contain the `field_vectors` field set.
775
+ """
776
+ return (
777
+ len(bm.field_vectors) > 0
778
+ and not bm.HasField("basic")
779
+ and len(bm.delete_fields) == 0
780
+ and len(bm.files) == 0
781
+ and len(bm.texts) == 0
782
+ and len(bm.conversations) == 0
783
+ and len(bm.links) == 0
784
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.3.4.post3740
3
+ Version: 6.3.4.post3762
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License: AGPL
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: <4,>=3.9
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: nucliadb-telemetry[all]>=6.3.4.post3740
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.4.post3740
25
- Requires-Dist: nucliadb-protos>=6.3.4.post3740
26
- Requires-Dist: nucliadb-models>=6.3.4.post3740
27
- Requires-Dist: nidx-protos>=6.3.4.post3740
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.3.4.post3762
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.4.post3762
25
+ Requires-Dist: nucliadb-protos>=6.3.4.post3762
26
+ Requires-Dist: nucliadb-models>=6.3.4.post3762
27
+ Requires-Dist: nidx-protos>=6.3.4.post3762
28
28
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
29
29
  Requires-Dist: nuclia-models>=0.24.2
30
30
  Requires-Dist: uvicorn
@@ -151,7 +151,7 @@ nucliadb/ingest/orm/processor/__init__.py,sha256=Aqd9wCNTvggkMkCY3WvoI8spdr94Jnq
151
151
  nucliadb/ingest/orm/processor/auditing.py,sha256=TeYhXGJRyQ7ROytbb2u8R0fIh_FYi3HgTu3S1ribY3U,4623
152
152
  nucliadb/ingest/orm/processor/data_augmentation.py,sha256=HpSU9olDHcTfECDYCsmm4yA-Hu0mBrd_zTtx50XDGFE,5164
153
153
  nucliadb/ingest/orm/processor/pgcatalog.py,sha256=f32PIEXWktWzGDws6Ffife37OAfrseP5IOti_Cb4ir8,3012
154
- nucliadb/ingest/orm/processor/processor.py,sha256=wjZmfJumypdGoKVB0BEJ51ha3xNRs1CzDZbFGj7z4_8,31668
154
+ nucliadb/ingest/orm/processor/processor.py,sha256=Tb87wm9Yqd4sS_x_wFTaIG3Tn3sznG8AuLCOanYhVDQ,32536
155
155
  nucliadb/ingest/orm/processor/sequence_manager.py,sha256=uqEphtI1Ir_yk9jRl2gPf7BlzzXWovbARY5MNZSBI_8,1704
156
156
  nucliadb/ingest/service/__init__.py,sha256=MME_G_ERxzJR6JW_hfE2qcfXpmpH1kdG-S0a-M0qRm8,2043
157
157
  nucliadb/ingest/service/exceptions.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
@@ -354,8 +354,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
354
354
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
355
355
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
356
356
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
357
- nucliadb-6.3.4.post3740.dist-info/METADATA,sha256=kXv8CG9jprFzMIeB6zi4A3R9gUN7RQ9J2CiTGBolbu0,4291
358
- nucliadb-6.3.4.post3740.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
359
- nucliadb-6.3.4.post3740.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
360
- nucliadb-6.3.4.post3740.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
361
- nucliadb-6.3.4.post3740.dist-info/RECORD,,
357
+ nucliadb-6.3.4.post3762.dist-info/METADATA,sha256=Zr2XIrUsS85ApCvFMDHlLy5RwSd_sNZjds-dEClJkqg,4291
358
+ nucliadb-6.3.4.post3762.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
359
+ nucliadb-6.3.4.post3762.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
360
+ nucliadb-6.3.4.post3762.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
361
+ nucliadb-6.3.4.post3762.dist-info/RECORD,,