nucliadb 6.2.0.post2650__py3-none-any.whl → 6.2.0.post2657__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.
@@ -37,7 +37,6 @@ from nucliadb.export_import.utils import (
37
37
  )
38
38
  from nucliadb_protos import knowledgebox_pb2 as kb_pb2
39
39
  from nucliadb_protos import resources_pb2, writer_pb2
40
- from nucliadb_utils.utilities import _create_storage
41
40
 
42
41
  BinaryStream = AsyncGenerator[bytes, None]
43
42
  BinaryStreamGenerator = Callable[[int], BinaryStream]
@@ -98,28 +97,17 @@ async def import_kb_from_blob_storage(context: ApplicationContext, msg: NatsTask
98
97
  """
99
98
  Imports to a knowledgebox from an export stored in the blob storage service.
100
99
  """
101
- try:
102
- # There is an issue when using the same aiobotocore client to download and upload files concurrently.
103
- # https://github.com/aio-libs/aiobotocore/issues/1235
104
- #
105
- # As a workaround, we use a newly created client for the download of the import file, while using
106
- # the normally configured storage for the uploads:
107
- # - The `ExportImportDataManager` is used for the downloads and gets the new storage
108
- # - `import_kb` gets the `context` with the default blob storage to use in uploads
109
- download_storage = await _create_storage()
110
- kbid, import_id = msg.kbid, msg.id
111
- dm = ExportImportDataManager(context.kv_driver, download_storage)
112
- metadata = await dm.get_metadata(type="import", kbid=kbid, id=import_id)
113
-
114
- retry_handler = TaskRetryHandler("import", dm, metadata)
115
-
116
- @retry_handler.wrap
117
- async def import_kb_retried(context, kbid, metadata):
118
- stream = dm.download_import(kbid, import_id)
119
- await import_kb(context, kbid, stream, metadata)
120
-
121
- await import_kb_retried(context, kbid, metadata)
122
-
123
- await dm.try_delete_from_storage("import", kbid, import_id)
124
- finally:
125
- await download_storage.finalize()
100
+ kbid, import_id = msg.kbid, msg.id
101
+ dm = ExportImportDataManager(context.kv_driver, context.blob_storage)
102
+ metadata = await dm.get_metadata(type="import", kbid=kbid, id=import_id)
103
+
104
+ retry_handler = TaskRetryHandler("import", dm, metadata)
105
+
106
+ @retry_handler.wrap
107
+ async def import_kb_retried(context, kbid, metadata):
108
+ stream = dm.download_import(kbid, import_id)
109
+ await import_kb(context, kbid, stream, metadata)
110
+
111
+ await import_kb_retried(context, kbid, metadata)
112
+
113
+ await dm.try_delete_from_storage("import", kbid, import_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb
3
- Version: 6.2.0.post2650
3
+ Version: 6.2.0.post2657
4
4
  Home-page: https://docs.nuclia.dev/docs/management/nucliadb/intro
5
5
  Author: NucliaDB Community
6
6
  Author-email: nucliadb@nuclia.com
@@ -22,16 +22,16 @@ Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3 :: Only
23
23
  Requires-Python: >=3.9, <4
24
24
  Description-Content-Type: text/markdown
25
- Requires-Dist: nucliadb-telemetry[all]>=6.2.0.post2650
26
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.0.post2650
27
- Requires-Dist: nucliadb-protos>=6.2.0.post2650
28
- Requires-Dist: nucliadb-models>=6.2.0.post2650
25
+ Requires-Dist: nucliadb-telemetry[all]>=6.2.0.post2657
26
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.0.post2657
27
+ Requires-Dist: nucliadb-protos>=6.2.0.post2657
28
+ Requires-Dist: nucliadb-models>=6.2.0.post2657
29
29
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
30
30
  Requires-Dist: nucliadb-node-binding>=2.26.0
31
31
  Requires-Dist: nuclia-models>=0.24.2
32
32
  Requires-Dist: uvicorn
33
33
  Requires-Dist: argdantic
34
- Requires-Dist: aiohttp>=3.9.4
34
+ Requires-Dist: aiohttp>=3.11.11
35
35
  Requires-Dist: lru-dict>=1.1.7
36
36
  Requires-Dist: backoff
37
37
  Requires-Dist: aiofiles>=0.8.0
@@ -100,7 +100,7 @@ nucliadb/export_import/__init__.py,sha256=y-Is0Bxa8TMV6UiOW0deC_D3U465P65CQ5RjBj
100
100
  nucliadb/export_import/datamanager.py,sha256=b9Vhf-WqJ8HosTdNpKXlGj-Vi7MHyMoPxL0VpfPlYlE,6720
101
101
  nucliadb/export_import/exceptions.py,sha256=Dw8WqfG4r6MPJc5TPfbjMvCgXXWTcTOecGHRVU1h3kM,1949
102
102
  nucliadb/export_import/exporter.py,sha256=kgbW-B7FNW7mlc9rBVEfwkkFTqD58TWSTDe9zkmEnBc,7098
103
- nucliadb/export_import/importer.py,sha256=_tzoE2dUfLPivjp8CPE5BMMRCCr_1heOrWmqIe89_LQ,4964
103
+ nucliadb/export_import/importer.py,sha256=v5cq9Nn8c2zrY_K_00mydR52f8mdFxR7tLdtNLQ0qvk,4229
104
104
  nucliadb/export_import/models.py,sha256=VHetyHlofHH5yzcV5q6hN15zGKJTRAu7GOTNveN-tGA,2063
105
105
  nucliadb/export_import/tasks.py,sha256=fpCBeFYPReyLIdk38LDM9Tpnw_VczeMrobT4n1RAIp4,2507
106
106
  nucliadb/export_import/utils.py,sha256=zrNrkkc9i3uT-R6Ju4J_0WNrzayln3KuQFCz-_qIaIA,19613
@@ -332,9 +332,9 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
332
332
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
333
333
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
334
334
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
335
- nucliadb-6.2.0.post2650.dist-info/METADATA,sha256=Ht1LmyDdEsMoQ_VRgjZtxPstn9UKqaJzOTk8zs5Pj2s,4427
336
- nucliadb-6.2.0.post2650.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
337
- nucliadb-6.2.0.post2650.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
338
- nucliadb-6.2.0.post2650.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
339
- nucliadb-6.2.0.post2650.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
340
- nucliadb-6.2.0.post2650.dist-info/RECORD,,
335
+ nucliadb-6.2.0.post2657.dist-info/METADATA,sha256=9OACWvQawqClCIDZ7PmhRyx3ICQamMKVzd0FmBUYX_U,4429
336
+ nucliadb-6.2.0.post2657.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
337
+ nucliadb-6.2.0.post2657.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
338
+ nucliadb-6.2.0.post2657.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
339
+ nucliadb-6.2.0.post2657.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
340
+ nucliadb-6.2.0.post2657.dist-info/RECORD,,