nucliadb-dataset 6.9.1.post5187__py3-none-any.whl → 6.10.0.post5647__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.
@@ -14,7 +14,7 @@
14
14
 
15
15
  import re
16
16
  import tempfile
17
- from typing import AsyncIterator, Iterator, Optional
17
+ from typing import TYPE_CHECKING, AsyncIterator, Iterator, Optional
18
18
 
19
19
  import docker # type: ignore
20
20
  import grpc
@@ -22,7 +22,6 @@ import pytest
22
22
  from grpc import aio
23
23
 
24
24
  from nucliadb_models.common import UserClassification
25
- from nucliadb_models.entities import CreateEntitiesGroupPayload, Entity
26
25
  from nucliadb_models.labels import Label, LabelSet, LabelSetKind
27
26
  from nucliadb_models.metadata import UserMetadata
28
27
  from nucliadb_models.resource import KnowledgeBoxObj
@@ -35,6 +34,9 @@ from nucliadb_sdk.v2.sdk import NucliaDB
35
34
  DOCKER_ENV_GROUPS = re.search(r"//([^:]+)", docker.from_env().api.base_url)
36
35
  DOCKER_HOST: Optional[str] = DOCKER_ENV_GROUPS.group(1) if DOCKER_ENV_GROUPS else None
37
36
 
37
+ if TYPE_CHECKING:
38
+ from nucliadb_protos.writer_pb2_grpc import WriterAsyncStub
39
+
38
40
 
39
41
  @pytest.fixture(scope="function")
40
42
  def upload_data_field_classification(sdk: NucliaDB, kb: KnowledgeBoxObj):
@@ -156,70 +158,6 @@ def upload_data_paragraph_classification(sdk: NucliaDB, kb: KnowledgeBoxObj):
156
158
  return kb
157
159
 
158
160
 
159
- @pytest.fixture(scope="function")
160
- def upload_data_token_classification(sdk: NucliaDB, kb: KnowledgeBoxObj):
161
- sdk.create_entitygroup(
162
- kbid=kb.uuid,
163
- content=CreateEntitiesGroupPayload(
164
- group="PERSON",
165
- entities={
166
- "ramon": Entity(value="Ramon"),
167
- "carmen": Entity(value="Carmen Iniesta"),
168
- "eudald": Entity(value="Eudald Camprubi"),
169
- },
170
- title="Animals",
171
- color="black",
172
- ),
173
- )
174
-
175
- sdk.create_entitygroup(
176
- kbid=kb.uuid,
177
- content=CreateEntitiesGroupPayload(
178
- group="ANIMAL",
179
- entities={
180
- "cheetah": Entity(value="cheetah"),
181
- "tiger": Entity(value="tiger"),
182
- "lion": Entity(value="lion"),
183
- },
184
- title="Animals",
185
- color="black",
186
- ),
187
- )
188
- sdk.create_resource(
189
- kbid=kb.uuid,
190
- content=CreateResourcePayload(
191
- slug=SlugString("doc1"),
192
- texts={FieldIdString("text"): TextField(body="Ramon This is my lovely text")},
193
- ),
194
- )
195
-
196
- sdk.create_resource(
197
- kbid=kb.uuid,
198
- content=CreateResourcePayload(
199
- slug=SlugString("doc2"),
200
- texts={
201
- FieldIdString("text"): TextField(
202
- body="Carmen Iniesta shows an amazing classifier to Eudald Camprubi"
203
- )
204
- },
205
- ),
206
- )
207
-
208
- sdk.create_resource(
209
- kbid=kb.uuid,
210
- content=CreateResourcePayload(
211
- slug=SlugString("doc3"),
212
- texts={
213
- FieldIdString("text"): TextField(
214
- body="Which is the fastest animal, a lion, a tiger or a cheetah?"
215
- )
216
- },
217
- ),
218
- )
219
-
220
- return kb
221
-
222
-
223
161
  @pytest.fixture(scope="function")
224
162
  def text_editors_kb(sdk: NucliaDB, kb: KnowledgeBoxObj):
225
163
  sdk.create_resource(
@@ -285,10 +223,10 @@ def temp_folder():
285
223
 
286
224
 
287
225
  @pytest.fixture
288
- async def ingest_stub(nucliadb) -> AsyncIterator[WriterStub]:
226
+ async def ingest_stub(nucliadb) -> AsyncIterator["WriterAsyncStub"]:
289
227
  channel = aio.insecure_channel(f"{nucliadb.host}:{nucliadb.grpc}")
290
228
  stub = WriterStub(channel)
291
- yield stub
229
+ yield stub # type: ignore
292
230
  await channel.close(grace=True)
293
231
 
294
232
 
@@ -296,5 +234,5 @@ async def ingest_stub(nucliadb) -> AsyncIterator[WriterStub]:
296
234
  def ingest_stub_sync(nucliadb) -> Iterator[WriterStub]:
297
235
  channel = grpc.insecure_channel(f"{nucliadb.host}:{nucliadb.grpc}")
298
236
  stub = WriterStub(channel)
299
- yield stub
237
+ yield stub # type: ignore
300
238
  channel.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb_dataset
3
- Version: 6.9.1.post5187
3
+ Version: 6.10.0.post5647
4
4
  Summary: NucliaDB Train Python client
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: Apache-2.0
@@ -10,12 +10,11 @@ Classifier: Development Status :: 3 - Alpha
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: Intended Audience :: Information Technology
12
12
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3 :: Only
18
- Requires-Python: <4,>=3.9
17
+ Requires-Python: <4,>=3.10
19
18
  Description-Content-Type: text/markdown
20
19
  Requires-Dist: protobuf
21
20
  Requires-Dist: types-protobuf
@@ -25,9 +24,9 @@ Requires-Dist: aiohttp
25
24
  Requires-Dist: argdantic
26
25
  Requires-Dist: pydantic-settings>=2.2
27
26
  Requires-Dist: pyarrow
28
- Requires-Dist: nucliadb-protos>=6.9.1.post5187
29
- Requires-Dist: nucliadb-sdk>=6.9.1.post5187
30
- Requires-Dist: nucliadb-models>=6.9.1.post5187
27
+ Requires-Dist: nucliadb-protos>=6.10.0.post5647
28
+ Requires-Dist: nucliadb-sdk>=6.10.0.post5647
29
+ Requires-Dist: nucliadb-models>=6.10.0.post5647
31
30
 
32
31
  # NUCLIADB TRAIN CLIENT
33
32
 
@@ -10,9 +10,9 @@ nucliadb_dataset/settings.py,sha256=9NYeJVgIHbLqCenUFRwj6Iz9S7klOROXQfzaUiBUEl0,
10
10
  nucliadb_dataset/streamer.py,sha256=aBzYWNQQVWM5qA14f8p0YQdshzC4KpOQFt3J0TYe1uk,3060
11
11
  nucliadb_dataset/tasks.py,sha256=198o37vDlzS7OdXrHYhtwI8kz2WHWJnxpholh-rtTPQ,6227
12
12
  nucliadb_dataset/tests/__init__.py,sha256=zG33bUz1rHFPtvqQPWn4rDwBJt3FJodGuQYD45quiQg,583
13
- nucliadb_dataset/tests/fixtures.py,sha256=Fx82tfwoFx0YyaiC6tg-ThUDvS8pcmFSE0Pm1KpAS0I,9242
14
- nucliadb_dataset-6.9.1.post5187.dist-info/METADATA,sha256=8TRTk350GTFzteUvygWVPGNjmay4cBY-dhjoed2vVMY,1263
15
- nucliadb_dataset-6.9.1.post5187.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- nucliadb_dataset-6.9.1.post5187.dist-info/entry_points.txt,sha256=ORrWnn6AUFfHGY1fWPRPTz99KV_pXXwttZAopyT8qvQ,60
17
- nucliadb_dataset-6.9.1.post5187.dist-info/top_level.txt,sha256=aJtDe54tz6060E0uyk1rdTRAU4FPWo5if1fYFQGvdqU,17
18
- nucliadb_dataset-6.9.1.post5187.dist-info/RECORD,,
13
+ nucliadb_dataset/tests/fixtures.py,sha256=5Ac20TKYmGe61d74yRT6hj0ENdLr3jT2Gbj2fiSX9LM,7510
14
+ nucliadb_dataset-6.10.0.post5647.dist-info/METADATA,sha256=bzo2_22-tenSkpguiIJFXWls9b6DfHNCEEIZG9eHxIU,1218
15
+ nucliadb_dataset-6.10.0.post5647.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ nucliadb_dataset-6.10.0.post5647.dist-info/entry_points.txt,sha256=ORrWnn6AUFfHGY1fWPRPTz99KV_pXXwttZAopyT8qvQ,60
17
+ nucliadb_dataset-6.10.0.post5647.dist-info/top_level.txt,sha256=aJtDe54tz6060E0uyk1rdTRAU4FPWo5if1fYFQGvdqU,17
18
+ nucliadb_dataset-6.10.0.post5647.dist-info/RECORD,,