nucliadb 6.3.7.post4119__py3-none-any.whl → 6.4.0.post4127__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.
@@ -22,6 +22,7 @@ import hashlib
22
22
  from typing import Optional
23
23
 
24
24
  from nucliadb.ingest.fields.base import Field
25
+ from nucliadb.ingest.fields.exceptions import FieldAuthorNotFound
25
26
  from nucliadb_protos.resources_pb2 import FieldAuthor, FieldText
26
27
 
27
28
 
@@ -32,7 +33,8 @@ class Text(Field[FieldText]):
32
33
 
33
34
  async def generated_by(self) -> FieldAuthor:
34
35
  value = await self.get_value()
35
- assert value is not None, "Can't know who generated the field if it has no value!"
36
+ if value is None:
37
+ raise FieldAuthorNotFound("Field has no value, can't know who generated it")
36
38
  return value.generated_by
37
39
 
38
40
  async def set_value(self, payload: FieldText):
@@ -576,7 +576,7 @@ class ResourceBrain:
576
576
  field_key: str,
577
577
  metadata: Optional[FieldComputedMetadata],
578
578
  uuid: str,
579
- generated_by: FieldAuthor,
579
+ generated_by: Optional[FieldAuthor],
580
580
  basic_user_metadata: Optional[UserMetadata] = None,
581
581
  basic_user_fieldmetadata: Optional[UserFieldMetadata] = None,
582
582
  ):
@@ -629,7 +629,7 @@ class ResourceBrain:
629
629
  paragraph_annotation.key
630
630
  ].labels.append(label)
631
631
 
632
- if generated_by.WhichOneof("author") == "data_augmentation":
632
+ if generated_by is not None and generated_by.WhichOneof("author") == "data_augmentation":
633
633
  field_type, field_id = field_key.split("/")
634
634
  da_task_id = ids.extract_data_augmentation_id(field_id)
635
635
  if da_task_id is None: # pragma: nocover
@@ -32,6 +32,7 @@ from nucliadb.common.ids import FIELD_TYPE_PB_TO_STR, FieldId
32
32
  from nucliadb.common.maindb.driver import Transaction
33
33
  from nucliadb.ingest.fields.base import Field
34
34
  from nucliadb.ingest.fields.conversation import Conversation
35
+ from nucliadb.ingest.fields.exceptions import FieldAuthorNotFound
35
36
  from nucliadb.ingest.fields.file import File
36
37
  from nucliadb.ingest.fields.generic import VALID_GENERIC_FIELDS, Generic
37
38
  from nucliadb.ingest.fields.link import Link
@@ -974,8 +975,10 @@ class Resource:
974
975
  ):
975
976
  valid_user_field_metadata = user_field_metadata
976
977
  break
977
-
978
- generated_by = await fieldobj.generated_by()
978
+ try:
979
+ generated_by = await fieldobj.generated_by()
980
+ except FieldAuthorNotFound:
981
+ generated_by = None
979
982
  brain.apply_field_labels(
980
983
  fieldkey,
981
984
  extracted_metadata,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.3.7.post4119
3
+ Version: 6.4.0.post4127
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.7.post4119
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.7.post4119
25
- Requires-Dist: nucliadb-protos>=6.3.7.post4119
26
- Requires-Dist: nucliadb-models>=6.3.7.post4119
27
- Requires-Dist: nidx-protos>=6.3.7.post4119
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.4.0.post4127
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.4.0.post4127
25
+ Requires-Dist: nucliadb-protos>=6.4.0.post4127
26
+ Requires-Dist: nucliadb-models>=6.4.0.post4127
27
+ Requires-Dist: nidx-protos>=6.4.0.post4127
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[standard]
@@ -141,9 +141,9 @@ nucliadb/ingest/fields/exceptions.py,sha256=sZBk21BSrXFdOdo1qUdCAyD-9YMYakSLdn4_
141
141
  nucliadb/ingest/fields/file.py,sha256=1v4jLg3balUua2VmSV8hHkAwPFShTUCOzufZvIUQcQw,4740
142
142
  nucliadb/ingest/fields/generic.py,sha256=elgtqv15aJUq3zY7X_g0bli_2BpcwPArVvzhe54Y4Ig,1547
143
143
  nucliadb/ingest/fields/link.py,sha256=kN_gjRUEEj5cy8K_BwPijYg3TiWhedc24apXYlTbRJs,4172
144
- nucliadb/ingest/fields/text.py,sha256=tFvSQJAe0W7ePpp2_WDfLiE2yglR1OTU0Zht9acvOFw,1594
144
+ nucliadb/ingest/fields/text.py,sha256=2grxo8twWbpXEd_iwUMBw9q0dWorVmlPONmY5d1ThwQ,1684
145
145
  nucliadb/ingest/orm/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
146
- nucliadb/ingest/orm/brain.py,sha256=nUfawCRc0hcv5p7EsblCrJ3dFW1GdSGRuQuubK-OCzU,29059
146
+ nucliadb/ingest/orm/brain.py,sha256=q8iW7TWgABcGG5gIrR4SN5Flv_hOy6uuSv3VL8aWgAk,29098
147
147
  nucliadb/ingest/orm/brain_v2.py,sha256=0OYqH9srWghajGh0l1oqTFPBh1Jtlw3ui3Qpww6IC7A,33573
148
148
  nucliadb/ingest/orm/broker_message.py,sha256=XWaiZgDOz94NPOPT-hqbRr5ZkpVimUw6PjUJNftfoVw,7514
149
149
  nucliadb/ingest/orm/entities.py,sha256=RU-hZW0is5vJARJfMq_2aQoy92mYRPXTo3ixy9FXXiE,14912
@@ -151,7 +151,7 @@ nucliadb/ingest/orm/exceptions.py,sha256=k4Esv4NtL4TrGTcsQpwrSfDhPQpiYcRbB1SpYmB
151
151
  nucliadb/ingest/orm/index_message.py,sha256=7Pl2qtqoI3b3NAjWfgoiLQktayngdsJ_NfDH0wpTJBw,16041
152
152
  nucliadb/ingest/orm/knowledgebox.py,sha256=_rkeTMIXMhR64gbYtZpFHoUHghV2DTJ2lUBqZsoqC_4,23898
153
153
  nucliadb/ingest/orm/metrics.py,sha256=OiuggTh-n3kZHA2G73NEUdIlh8c3yFrbusI88DK-Mko,1273
154
- nucliadb/ingest/orm/resource.py,sha256=GjxcEPuu8bM06Uea7_yJk0UFvOfiZNP9i_G4V-4D8_U,46845
154
+ nucliadb/ingest/orm/resource.py,sha256=nk-aT9mEPenmZ4blyqTbTOXCpJaSSi1AE-wTJ01V2vA,47007
155
155
  nucliadb/ingest/orm/utils.py,sha256=fCQRuyecgqhaY7mcBG93oaXMkzkKb9BFjOcy4-ZiSNw,2693
156
156
  nucliadb/ingest/orm/processor/__init__.py,sha256=Aqd9wCNTvggkMkCY3WvoI8spdr94Jnqk-0iq9XpLs18,922
157
157
  nucliadb/ingest/orm/processor/auditing.py,sha256=TeYhXGJRyQ7ROytbb2u8R0fIh_FYi3HgTu3S1ribY3U,4623
@@ -366,8 +366,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
366
366
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
367
367
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
368
368
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
369
- nucliadb-6.3.7.post4119.dist-info/METADATA,sha256=PRZ5eOyYzV85sQmOK4sddXKW_tJctYwZckWWISkKUK0,4226
370
- nucliadb-6.3.7.post4119.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
371
- nucliadb-6.3.7.post4119.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
372
- nucliadb-6.3.7.post4119.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
373
- nucliadb-6.3.7.post4119.dist-info/RECORD,,
369
+ nucliadb-6.4.0.post4127.dist-info/METADATA,sha256=DxoMD1dFTssNf-8DPOMdH5P-5X7RdOpkIbS-AcUKfj8,4226
370
+ nucliadb-6.4.0.post4127.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
371
+ nucliadb-6.4.0.post4127.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
372
+ nucliadb-6.4.0.post4127.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
373
+ nucliadb-6.4.0.post4127.dist-info/RECORD,,