From 994873425e7080c6264da78d3df9faf884d3a13d Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Fri, 10 Jul 2026 13:08:36 +0200 Subject: [PATCH 1/3] Update ty and clean type: ignores --- .../src/nucliadb/search/api/v1/augment.py | 4 +- .../nucliadb/search/augmentor/augmentor.py | 6 --- nucliadb/src/nucliadb/search/predict.py | 2 +- nucliadb/src/nucliadb/search/search/find.py | 2 +- .../tests/ingest/unit/orm/test_resource.py | 22 +++++----- .../tests/ingest/unit/service/test_writer.py | 2 +- .../tests/nucliadb/ask/test_ask_security.py | 5 ++- .../nucliadb/integration/test_security.py | 9 ++-- .../nucliadb/integration/test_vectorsets.py | 6 +++ .../unit/common/test_back_pressure.py | 14 +++--- .../nucliadb/unit/common/test_context.py | 6 +-- .../unit/export_import/test_datamanager.py | 8 ++-- .../integration/requesters/test_utils.py | 2 - .../unit/search/search/test_fetcher_cache.py | 2 +- nucliadb/tests/train/test_get_entities.py | 2 +- nucliadb_models/tests/test_metadata.py | 2 +- nucliadb_models/tests/test_search.py | 14 +++--- nucliadb_models/tests/test_security.py | 2 +- .../tests/unit/storages/test_storage.py | 8 ++-- nucliadb_utils/tests/unit/test_transaction.py | 2 +- uv.lock | 44 +++++++++---------- 21 files changed, 82 insertions(+), 82 deletions(-) diff --git a/nucliadb/src/nucliadb/search/api/v1/augment.py b/nucliadb/src/nucliadb/search/api/v1/augment.py index 0bea3e56ca..b720450998 100644 --- a/nucliadb/src/nucliadb/search/api/v1/augment.py +++ b/nucliadb/src/nucliadb/search/api/v1/augment.py @@ -240,7 +240,7 @@ def parse_first_augments(item: AugmentRequest) -> list[Augment]: if len(file_select) > 0: augmentations.append( FileAugment( - given=given, # type: ignore + given=given, # type: ignore[arg-type] select=file_select, ) ) @@ -277,7 +277,7 @@ def parse_first_augments(item: AugmentRequest) -> list[Augment]: if len(conversation_select) > 0: augmentations.append( ConversationAugment( - given=given, # type: ignore + given=given, # type: ignore[arg-type] select=conversation_select, ) ) diff --git a/nucliadb/src/nucliadb/search/augmentor/augmentor.py b/nucliadb/src/nucliadb/search/augmentor/augmentor.py index f6535cf32f..6e8bbc588b 100644 --- a/nucliadb/src/nucliadb/search/augmentor/augmentor.py +++ b/nucliadb/src/nucliadb/search/augmentor/augmentor.py @@ -113,27 +113,21 @@ def __init__(self, kbid: str): async def parse(self, augmentations: list[Augment]): for augmentation in augmentations: if augmentation.from_ == "resources": - augmentation = cast(ResourceAugment, augmentation) self._parse_resource(augmentation) elif augmentation.from_ == "resources.deep": - augmentation = cast(DeepResourceAugment, augmentation) self._parse_deep_resource(augmentation) elif augmentation.from_ == "fields": - augmentation = cast(FieldAugment, augmentation) await self._parse_field(augmentation) elif augmentation.from_ == "files": - augmentation = cast(FileAugment, augmentation) self._parse_file_field(augmentation) elif augmentation.from_ == "conversations": - augmentation = cast(ConversationAugment, augmentation) self._parse_conversation_field(augmentation) elif augmentation.from_ == "paragraphs": - augmentation = cast(ParagraphAugment, augmentation) self._parse_paragraph(augmentation) else: # pragma: no cover diff --git a/nucliadb/src/nucliadb/search/predict.py b/nucliadb/src/nucliadb/search/predict.py index 22a9a4093b..0cb9421d39 100644 --- a/nucliadb/src/nucliadb/search/predict.py +++ b/nucliadb/src/nucliadb/search/predict.py @@ -604,7 +604,7 @@ async def run_agents(self, kbid: str, item: RunAgentsRequest) -> RunAgentsRespon ada = AppliedDataAugmentation() serialized_fm = base64.b64encode(fm.SerializeToString()).decode("utf-8") augmented_field = AugmentedField( - metadata=serialized_fm, # type: ignore + metadata=serialized_fm, # type:ignore[arg-type] applied_data_augmentation=ada, input_nuclia_tokens=1.0, output_nuclia_tokens=1.0, diff --git a/nucliadb/src/nucliadb/search/search/find.py b/nucliadb/src/nucliadb/search/search/find.py index d63d734426..99ebbe9802 100644 --- a/nucliadb/src/nucliadb/search/search/find.py +++ b/nucliadb/src/nucliadb/search/search/find.py @@ -112,7 +112,7 @@ async def _ndb_index_find( ) text_block_hydration_options = TextBlockHydrationOptions( highlight=item.highlight, - ematches=pb_response.paragraph.ematches, # type: ignore + ematches=list(pb_response.paragraph.ematches), ) search_results = await build_find_response( pb_response, diff --git a/nucliadb/tests/ingest/unit/orm/test_resource.py b/nucliadb/tests/ingest/unit/orm/test_resource.py index 1d183f051a..f6fc127590 100644 --- a/nucliadb/tests/ingest/unit/orm/test_resource.py +++ b/nucliadb/tests/ingest/unit/orm/test_resource.py @@ -212,22 +212,22 @@ async def test_get_fields_ids_caches_keys(txn, storage, kb: str, rid: str): (FieldType.TEXT, "bar"), ] new_field_keys: list[tuple[FieldType.ValueType, str]] = [(FieldType.LINK, "baz")] - resource._inner_get_fields_ids = AsyncMock(return_value=new_field_keys) # type: ignore + resource._inner_get_fields_ids = AsyncMock(return_value=new_field_keys) # type: ignore[method-assign] resource.all_fields_keys = cached_field_keys assert await resource.get_fields_ids() == cached_field_keys - resource._inner_get_fields_ids.assert_not_awaited() # type: ignore[ty:unresolved-attribute] + resource._inner_get_fields_ids.assert_not_awaited() assert await resource.get_fields_ids(force=True) == new_field_keys - resource._inner_get_fields_ids.assert_awaited_once() # type: ignore[ty:unresolved-attribute] + resource._inner_get_fields_ids.assert_awaited_once() assert resource.all_fields_keys == new_field_keys # If the all_field_keys is an empty list, # we should not be calling the inner_get_fields_ids resource.all_fields_keys = [] - resource._inner_get_fields_ids.reset_mock() # type: ignore[ty:unresolved-attribute] + resource._inner_get_fields_ids.reset_mock() assert await resource.get_fields_ids() == [] - resource._inner_get_fields_ids.assert_not_awaited() # type: ignore[ty:unresolved-attribute] + resource._inner_get_fields_ids.assert_not_awaited() async def test_get_set_all_field_ids(txn, storage, kb, rid): @@ -313,8 +313,8 @@ async def test_update_all_fields_key(txn, storage, kb, rid): async def test_apply_fields_calls_update_all_field_ids(txn, storage, kb, rid): resource = Resource(txn, storage, kb, rid) - resource.update_all_field_ids = AsyncMock() # type: ignore - resource.set_field = AsyncMock() # type: ignore + resource.update_all_field_ids = AsyncMock() + resource.set_field = AsyncMock() bm = MagicMock() bm.texts = {"text": MagicMock()} @@ -323,17 +323,17 @@ async def test_apply_fields_calls_update_all_field_ids(txn, storage, kb, rid): bm.conversations = {"conversation": MagicMock()} bm.delete_fields.append(FieldID(field_type=FieldType.CONVERSATION, field="to_delete")) - await resource.apply_field_values(bm) # ty:ignore[invalid-argument-type] + await resource.apply_field_values(bm) - resource.update_all_field_ids.assert_awaited_once() # type: ignore[ty:unresolved-attribute] + resource.update_all_field_ids.assert_awaited_once() - resource.update_all_field_ids.call_args[1]["updated"] == [ # ty:ignore[unresolved-attribute] + assert resource.update_all_field_ids.call_args[1]["updated"] == [ FieldID(field_type=FieldType.TEXT, field="text"), FieldID(field_type=FieldType.LINK, field="link"), FieldID(field_type=FieldType.FILE, field="file"), FieldID(field_type=FieldType.CONVERSATION, field="conversation"), ] - resource.update_all_field_ids.call_args[1]["deleted"] == [ # ty:ignore[unresolved-attribute] + assert resource.update_all_field_ids.call_args[1]["deleted"] == [ FieldID(field_type=FieldType.CONVERSATION, field="to_delete"), ] diff --git a/nucliadb/tests/ingest/unit/service/test_writer.py b/nucliadb/tests/ingest/unit/service/test_writer.py index c08bf88876..ef1fa83dae 100644 --- a/nucliadb/tests/ingest/unit/service/test_writer.py +++ b/nucliadb/tests/ingest/unit/service/test_writer.py @@ -57,7 +57,7 @@ def field_value(self): def field(self, field_value): val = Text("id", Mock()) val.value = field_value.SerializeToString() - val.set_vectors = AsyncMock() # ty:ignore[invalid-assignment] + val.set_vectors = AsyncMock() yield val @pytest.fixture(scope="function") diff --git a/nucliadb/tests/nucliadb/ask/test_ask_security.py b/nucliadb/tests/nucliadb/ask/test_ask_security.py index 7b7664d2bf..9358c406d8 100644 --- a/nucliadb/tests/nucliadb/ask/test_ask_security.py +++ b/nucliadb/tests/nucliadb/ask/test_ask_security.py @@ -20,6 +20,7 @@ import asyncio import json +from typing import Any import pytest from httpx import AsyncClient @@ -227,12 +228,12 @@ async def _test_ask_request_with_security( security_groups: list[str] | None, expected_resources: list[str], ): - payload = { + payload: dict[str, Any] = { "query": query, } headers = {"x_synchronous": "true"} if security_groups: - payload["security"] = {"groups": security_groups} # type: ignore + payload["security"] = {"groups": security_groups} if ask_endpoint == "ask_post": resp = await nucliadb_reader.post(f"/kb/{kbid}/ask", json=payload, headers=headers) diff --git a/nucliadb/tests/nucliadb/integration/test_security.py b/nucliadb/tests/nucliadb/integration/test_security.py index ddde0fe03a..767fd1e622 100644 --- a/nucliadb/tests/nucliadb/integration/test_security.py +++ b/nucliadb/tests/nucliadb/integration/test_security.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # import asyncio +from typing import Any import pytest from httpx import AsyncClient @@ -246,15 +247,15 @@ async def _test_search_request_with_security( security_groups: list[str] | None, expected_resources: list[str], ): - payload = { + payload: dict[str, Any] = { "query": query, } - params = { + params: dict[str, Any] = { "query": query, } if security_groups is not None: - payload["security"] = {"groups": security_groups} # type: ignore - params["security_groups"] = security_groups # type: ignore + payload["security"] = {"groups": security_groups} + params["security_groups"] = security_groups if method == "POST" and endpoint == "find": resp = await nucliadb_reader.post( diff --git a/nucliadb/tests/nucliadb/integration/test_vectorsets.py b/nucliadb/tests/nucliadb/integration/test_vectorsets.py index 53e3d8aa5d..dab4623545 100644 --- a/nucliadb/tests/nucliadb/integration/test_vectorsets.py +++ b/nucliadb/tests/nucliadb/integration/test_vectorsets.py @@ -308,6 +308,7 @@ async def inner(*args, **kwargs): node_search_spy, result, error = query assert result is not None assert error is None + assert node_search_spy is not None request = node_search_spy.call_args[0][0] # there's only one model and we get it as the default @@ -326,6 +327,7 @@ async def inner(*args, **kwargs): node_search_spy, result, error = query assert result is not None assert error is None + assert node_search_spy is not None request = node_search_spy.call_args[0][0] assert request.vectorset == "model" @@ -375,6 +377,7 @@ async def inner(*args, **kwargs): node_search_spy, result, error = query assert result is not None assert error is None + assert node_search_spy is not None request = node_search_spy.call_args[0][0] assert request.vectorset == "model-A" @@ -399,6 +402,7 @@ async def inner(*args, **kwargs): node_search_spy, result, error = query assert result is not None assert error is None + assert node_search_spy is not None request = node_search_spy.call_args[0][0] assert request.vectorset == "model-B" @@ -421,6 +425,8 @@ async def inner(*args, **kwargs): ) assert resp.status_code == 200 node_search_spy, result, error = query + assert node_search_spy is not None + request = node_search_spy.call_args[0][0] assert result is not None assert error is None diff --git a/nucliadb/tests/nucliadb/unit/common/test_back_pressure.py b/nucliadb/tests/nucliadb/unit/common/test_back_pressure.py index e78ef395e9..dec6dac17b 100644 --- a/nucliadb/tests/nucliadb/unit/common/test_back_pressure.py +++ b/nucliadb/tests/nucliadb/unit/common/test_back_pressure.py @@ -140,28 +140,28 @@ async def test_check_processing_behind(settings, cache, nats_conn): settings.max_processing_pending = 5 materializer = BackPressureMaterializer(nats_conn) - materializer.get_processing_pending = mock.AsyncMock(return_value=1) # ty:ignore[invalid-assignment] + materializer.get_processing_pending = mock.AsyncMock(return_value=1) # Check that it runs and does not raise an exception if the pending is low await materializer.check_processing("kbid") - materializer.get_processing_pending.assert_awaited_once_with("kbid") # ty:ignore[unresolved-attribute] + materializer.get_processing_pending.assert_awaited_once_with("kbid") # Check that it raises an exception if the pending is too high - materializer.get_processing_pending.reset_mock() # ty:ignore[unresolved-attribute] - materializer.get_processing_pending.return_value = 10 # ty:ignore[unresolved-attribute] + materializer.get_processing_pending.reset_mock() + materializer.get_processing_pending.return_value = 10 with pytest.raises(BackPressureException): await materializer.check_processing("kbid") - materializer.get_processing_pending.assert_awaited_once_with("kbid") # ty:ignore[unresolved-attribute] + materializer.get_processing_pending.assert_awaited_once_with("kbid") async def test_check_processing_behind_does_not_run_if_configured_max_is_zero(settings, cache): settings.max_processing_pending = 0 materializer = BackPressureMaterializer(mock.Mock()) - materializer.get_processing_pending = mock.AsyncMock(return_value=100) # ty:ignore[invalid-assignment] + materializer.get_processing_pending = mock.AsyncMock(return_value=100) await materializer.check_processing("kbid") - materializer.get_processing_pending.assert_not_called() # ty:ignore[unresolved-attribute] + materializer.get_processing_pending.assert_not_called() async def test_check_ingest_behind(settings, cache): diff --git a/nucliadb/tests/nucliadb/unit/common/test_context.py b/nucliadb/tests/nucliadb/unit/common/test_context.py index e6c45ea9ba..27ddffedcd 100644 --- a/nucliadb/tests/nucliadb/unit/common/test_context.py +++ b/nucliadb/tests/nucliadb/unit/common/test_context.py @@ -25,12 +25,12 @@ async def test_initialize_happens_only_once(): context = ApplicationContext() - context._initialize = AsyncMock() # ty:ignore[invalid-assignment] + context._initialize = AsyncMock() tasks = [] for _ in range(10): tasks.append(context.initialize()) await asyncio.gather(*tasks) - context._initialize.assert_awaited_once() # ty:ignore[unresolved-attribute] - context._initialized is True + context._initialize.assert_awaited_once() + assert context._initialized is True diff --git a/nucliadb/tests/nucliadb/unit/export_import/test_datamanager.py b/nucliadb/tests/nucliadb/unit/export_import/test_datamanager.py index 8582466609..93c213c7d2 100644 --- a/nucliadb/tests/nucliadb/unit/export_import/test_datamanager.py +++ b/nucliadb/tests/nucliadb/unit/export_import/test_datamanager.py @@ -27,11 +27,11 @@ async def test_try_delete_from_storage(): storage = Mock() dm = ExportImportDataManager(driver, storage) - dm.delete_export = AsyncMock(side_effect=ValueError()) # type: ignore - dm.delete_import = AsyncMock(side_effect=ValueError()) # type: ignore + dm.delete_export = AsyncMock(side_effect=ValueError()) + dm.delete_import = AsyncMock(side_effect=ValueError()) await dm.try_delete_from_storage("export", "kbid", "foo") await dm.try_delete_from_storage("import", "kbid", "foo") - dm.delete_export.assert_called() # ty:ignore[unresolved-attribute] - dm.delete_import.assert_called() # ty:ignore[unresolved-attribute] + dm.delete_export.assert_called() + dm.delete_import.assert_called() diff --git a/nucliadb/tests/search/integration/requesters/test_utils.py b/nucliadb/tests/search/integration/requesters/test_utils.py index 2b952519a6..8c572f9985 100644 --- a/nucliadb/tests/search/integration/requesters/test_utils.py +++ b/nucliadb/tests/search/integration/requesters/test_utils.py @@ -44,8 +44,6 @@ async def test_vector_result_metadata(nucliadb_search: AsyncClient, test_search_ SearchRequest( query="own text", features=[SearchOptions.SEMANTIC], - label_filters=[], # type: ignore - keyword_filters=[], # type: ignore faceted=[], top_k=20, min_score=MinScore(bm25=0, semantic=-1), diff --git a/nucliadb/tests/search/unit/search/search/test_fetcher_cache.py b/nucliadb/tests/search/unit/search/search/test_fetcher_cache.py index 69589c18a7..f6e220c7d1 100644 --- a/nucliadb/tests/search/unit/search/search/test_fetcher_cache.py +++ b/nucliadb/tests/search/unit/search/search/test_fetcher_cache.py @@ -67,5 +67,5 @@ def new_fetcher() -> Fetcher: generative_model=None, query_image=None, ) - fetcher.get_vectorset = AsyncMock(return_value=vectorset) # type: ignore + fetcher.get_vectorset = AsyncMock(return_value=vectorset) # type: ignore[method-assign] return fetcher diff --git a/nucliadb/tests/train/test_get_entities.py b/nucliadb/tests/train/test_get_entities.py index 5d6142e970..34fac24cd0 100644 --- a/nucliadb/tests/train/test_get_entities.py +++ b/nucliadb/tests/train/test_get_entities.py @@ -34,7 +34,7 @@ async def entities_manager_mock(): original = nodes.EntitiesManager mock = Mock() - nodes.EntitiesManager = Mock(return_value=mock) # ty:ignore[invalid-assignment] + nodes.EntitiesManager = Mock(return_value=mock) yield mock diff --git a/nucliadb_models/tests/test_metadata.py b/nucliadb_models/tests/test_metadata.py index 6af01df854..eb57ff7a68 100644 --- a/nucliadb_models/tests/test_metadata.py +++ b/nucliadb_models/tests/test_metadata.py @@ -27,7 +27,7 @@ def test_relation_validator(): ) with pytest.raises(ValidationError): - metadata.UserMetadata(relations=["my-wrong-relation"]) # type: ignore + metadata.UserMetadata(relations=["my-wrong-relation"]) def test_relation_entity_model_validator(): diff --git a/nucliadb_models/tests/test_search.py b/nucliadb_models/tests/test_search.py index 9905302baa..032cb0b390 100644 --- a/nucliadb_models/tests/test_search.py +++ b/nucliadb_models/tests/test_search.py @@ -65,13 +65,13 @@ def test_field_extension_strategy_fields_field_validator(): def test_find_request_fulltext_feature_not_allowed(): with pytest.raises(ValidationError): - search.FindRequest(features=[search.SearchOptions.FULLTEXT]) # type: ignore + search.FindRequest(features=[search.SearchOptions.FULLTEXT]) def test_find_supports_search_options(): - search.FindRequest(features=[search.SearchOptions.KEYWORD]) # type: ignore - search.FindRequest(features=[search.SearchOptions.SEMANTIC]) # type: ignore - search.FindRequest(features=[search.SearchOptions.RELATIONS]) # type: ignore + search.FindRequest(features=[search.SearchOptions.KEYWORD]) + search.FindRequest(features=[search.SearchOptions.SEMANTIC]) + search.FindRequest(features=[search.SearchOptions.RELATIONS]) def test_search_semantic_with_offset_not_supported(): @@ -149,13 +149,13 @@ def test_rank_fusion(rank_fusion, expected): def test_rank_fusion_errors(): with pytest.raises(ValueError): - search.FindRequest(rank_fusion="unknown") # type: ignore + search.FindRequest(rank_fusion="unknown") with pytest.raises(ValueError): - search.AskRequest(query="q", rank_fusion="unknown") # type: ignore + search.AskRequest(query="q", rank_fusion="unknown") def test_legacy_rank_fusion_fix(): - req = search.FindRequest(rank_fusion="legacy") # type: ignore + req = search.FindRequest(rank_fusion="legacy") assert req.rank_fusion == "rrf" req = search.FindRequest.model_validate({"rank_fusion": "legacy"}) diff --git a/nucliadb_models/tests/test_security.py b/nucliadb_models/tests/test_security.py index bcdd3ad48e..47a858d07b 100644 --- a/nucliadb_models/tests/test_security.py +++ b/nucliadb_models/tests/test_security.py @@ -20,7 +20,7 @@ def test_security_groups_alias() -> None: assert ( security.RequestSecurity(groups=["A", "B", "C"]) - == security.RequestSecurity(access_groups=["A", "B", "C"]) # type: ignore[call-arg,ty:unknown-argument] # We want to explictly use the alias + == security.RequestSecurity(access_groups=["A", "B", "C"]) # type: ignore[call-arg] # We want to explictly use the alias == security.RequestSecurity.model_validate({"groups": ["A", "B", "C"]}) == security.RequestSecurity.model_validate({"access_groups": ["A", "B", "C"]}) ) diff --git a/nucliadb_utils/tests/unit/storages/test_storage.py b/nucliadb_utils/tests/unit/storages/test_storage.py index daae243936..d5b85086d9 100644 --- a/nucliadb_utils/tests/unit/storages/test_storage.py +++ b/nucliadb_utils/tests/unit/storages/test_storage.py @@ -56,9 +56,9 @@ def __init__(self): self.field_klass = lambda: MagicMock() # type: ignore[ty:invalid-assignment] self.deadletter_bucket = "deadletter_bucket" self.indexing_bucket = "indexing_bucket" - self.chunked_upload_object = AsyncMock() # type: ignore[ty:invalid-assignment] - self.upload_object = AsyncMock() # type: ignore[ty:invalid-assignment] - self.move = AsyncMock() # type: ignore[ty:invalid-assignment] + self.chunked_upload_object = AsyncMock() + self.upload_object = AsyncMock() + self.move = AsyncMock() def get_bucket_name(self, kbid): return "bucket" @@ -99,7 +99,7 @@ class TestStorage: @pytest.fixture def storage(self): s = StorageTest() - s.delete_upload = AsyncMock() # type: ignore[ty:invalid-assignment] + s.delete_upload = AsyncMock() yield s async def test_delete_resource(self, storage: StorageTest): diff --git a/nucliadb_utils/tests/unit/test_transaction.py b/nucliadb_utils/tests/unit/test_transaction.py index 7c22574323..79a4b09f43 100644 --- a/nucliadb_utils/tests/unit/test_transaction.py +++ b/nucliadb_utils/tests/unit/test_transaction.py @@ -89,7 +89,7 @@ async def test_commit_timeout(txn: TransactionUtility, pubsub): bm = BrokerMessage() waiting_event = mock.Mock(wait=mock.Mock(side_effect=asyncio.TimeoutError)) - txn.wait_for_commited = mock.AsyncMock(return_value=waiting_event) # type: ignore + txn.wait_for_commited = mock.AsyncMock(return_value=waiting_event) with pytest.raises(TransactionCommitTimeoutError): await txn.commit(bm, 1, wait=True, target_subject="foo") diff --git a/uv.lock b/uv.lock index cfa86616bc..cae1587558 100644 --- a/uv.lock +++ b/uv.lock @@ -905,7 +905,7 @@ name = "exceptiongroup" version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -4441,27 +4441,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.40" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5a/f8/a754c96967b71de8723f88be17df8738216bd382ffed229cd500b7a24d13/ty-0.0.40.tar.gz", hash = "sha256:883b53dd98f6e5b33ab1c8e1a3cd94b0f29c762ef22cdf1e86aaffb4fd711c67", size = 5726484, upload-time = "2026-05-27T17:55:43.615Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/42/d029a72165ad39f95228b67355927fbd35c821dc8e3e475d49f47c2eeb1e/ty-0.0.40-py3-none-linux_armv6l.whl", hash = "sha256:9defb4742450e569a6a09de286a04008d6c2e815112da4362c88b6eaa2f52a36", size = 11406372, upload-time = "2026-05-27T17:55:49.633Z" }, - { url = "https://files.pythonhosted.org/packages/23/99/7f8ea09b7e49afbf795cb3341a3217f30f228db7e62a2268ed8cbbf813d6/ty-0.0.40-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:868258a3330db88b683fcafe2c4e936d6226a6312799bf15b585d93557b2d38c", size = 11159782, upload-time = "2026-05-27T17:55:47.405Z" }, - { url = "https://files.pythonhosted.org/packages/04/d8/1ea745ee97a98b26ae9564d19a430a76a35297cd450e84dcaad22e1f7ee8/ty-0.0.40-py3-none-macosx_11_0_arm64.whl", hash = "sha256:589c81060cf1e7a9ffa2f45bfa35ffd9b9fbd214104e3f13959f113627efcd91", size = 10594139, upload-time = "2026-05-27T17:55:37.206Z" }, - { url = "https://files.pythonhosted.org/packages/39/1a/fbef21273c6617ff4715b4827ee1c0b6550aa7d1df4b8c43b325545c1cf4/ty-0.0.40-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b06108990cb338d941c315ae6e9ba2fff8f518bc15d3f33e5619ff6a6c9beab", size = 11114156, upload-time = "2026-05-27T17:55:56.11Z" }, - { url = "https://files.pythonhosted.org/packages/3c/f9/389fc4976d7ec016a7473cf1274bf9c4f491bb54c66649bd022bff9f2b6a/ty-0.0.40-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3913ef37336bec4f96bd2512f8c3a543ca34c259b7170f7eb5adf75b3ed7f04c", size = 11189050, upload-time = "2026-05-27T17:55:54.099Z" }, - { url = "https://files.pythonhosted.org/packages/fa/a9/4ecabbf4bdda7df0d99d8d3892c6edac0efc8c4cae756a5109178a3d0e86/ty-0.0.40-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8fd1486bd5fe48779a8aa857137f3642a0a9161f5cf57d4380f4a0ecea01c8f3", size = 11664266, upload-time = "2026-05-27T17:55:28.17Z" }, - { url = "https://files.pythonhosted.org/packages/45/02/0aa78730116507c265afb1d6d5961c583b49d4c2e368c4a49fd81bcae6dc/ty-0.0.40-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1668364d5254a734329917ee66c2c5fdd5665389d41043f6fce0f22ddb32b749", size = 12187743, upload-time = "2026-05-27T17:56:04.337Z" }, - { url = "https://files.pythonhosted.org/packages/e6/68/ccabf2d173523598271a385c1d3f864dbda23e5ebdc67f5969b9e830ea05/ty-0.0.40-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:43f77a73edb91e5dfa2ab9af7c4cac64614f8cc121f38a8875f22e830d3aba6a", size = 11862999, upload-time = "2026-05-27T17:55:58.087Z" }, - { url = "https://files.pythonhosted.org/packages/03/8d/6d7ec22771bb23d534797cdb446eb644bccfe7a62b729bb99e7235a02fc3/ty-0.0.40-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1274ce0212ecbfed01bda7c3659c46e8bd0068e32d00c46c790466a95274c3df", size = 11743896, upload-time = "2026-05-27T17:56:00.017Z" }, - { url = "https://files.pythonhosted.org/packages/cd/a4/f9fa076b010c91cb249b1fcc3476569b7b8462cb4b688da2d04c23a0622f/ty-0.0.40-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:5ee1261dbc363e5cc1a0c5bb0c8612c192bfe53491214df8bc85a540835685f9", size = 11883581, upload-time = "2026-05-27T17:56:02.319Z" }, - { url = "https://files.pythonhosted.org/packages/fd/0f/5b776a2328c756d574dd4d6afbd30fc24e1ab4b76935c7c3c23f27ebbcb9/ty-0.0.40-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6220e2cd5cdc4683dd87fb150d195bbd9f1a021395e04cb08bd3c66ea6da6ef8", size = 11093946, upload-time = "2026-05-27T17:55:33.284Z" }, - { url = "https://files.pythonhosted.org/packages/64/c4/eb23154bae83ad7c2935e9e5916660fb3e31598a92ee232aebd79410480c/ty-0.0.40-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:46b9ed69d01d98ef046afac9983c68336f572605ea2a27b90fbe6f80bfc8d6b7", size = 11210737, upload-time = "2026-05-27T17:55:45.523Z" }, - { url = "https://files.pythonhosted.org/packages/ff/19/1fb2529703f708cacfd13a89f98613cae2907dfa941b26976467e6119803/ty-0.0.40-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ddbca9fab4406260f141674ab5efcfe7b02bd468e6985e4cdde0a21626e69ffe", size = 11332563, upload-time = "2026-05-27T17:55:41.674Z" }, - { url = "https://files.pythonhosted.org/packages/87/69/b3f5a8ef26c31204e0391147b3adcdb0674eda3e7d99868478ef168a41c6/ty-0.0.40-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b1fcc082a749e6dc11b68fe9aab0420238bbf2a2374c2c7aa3c22e8c1618b136", size = 11843216, upload-time = "2026-05-27T17:55:35.367Z" }, - { url = "https://files.pythonhosted.org/packages/ac/e8/20193069d32787f3e1a6ec8940aaa3759d3de8f48f9281bcc0c5cb0939da/ty-0.0.40-py3-none-win32.whl", hash = "sha256:75feb115b3587824c5bdf8f8305e9547b0d1e398e3077b0addc7a1988ea9bb50", size = 10670731, upload-time = "2026-05-27T17:55:31.316Z" }, - { url = "https://files.pythonhosted.org/packages/a3/f9/8b2aa4da61db81322d4a2f9db227afeb48110ca15ae31d380f64c64ceb63/ty-0.0.40-py3-none-win_amd64.whl", hash = "sha256:b0f905edaad788bd61f779a85801b60a267a25ed57fca05aaddd168d9d8896be", size = 11766211, upload-time = "2026-05-27T17:55:51.898Z" }, - { url = "https://files.pythonhosted.org/packages/04/87/369056ed46f1b235130ec0595393262f9cd2061ca3dab276d490980f9343/ty-0.0.40-py3-none-win_arm64.whl", hash = "sha256:07da2b09d9130e2c9a257d2a29beb53105835b0256ee5fdb288fe1aab83fee47", size = 11117369, upload-time = "2026-05-27T17:55:39.329Z" }, +version = "0.0.58" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/09/4c/26c90732658903aeb1d289208f7b7b492fa21029e0c4d6c51bdd6f8f5e51/ty-0.0.58.tar.gz", hash = "sha256:8f22484174e65c630660a454bf81b80cae7a3a7e70479f19c170d6cd87949258", size = 6133665, upload-time = "2026-07-10T03:09:30.542Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/51/e1/5d1aa2a75829459834689f080e4be7a9d8828ce14b939ebed69161a35811/ty-0.0.58-py3-none-linux_armv6l.whl", hash = "sha256:47412850b6fbef61c42f244f6a51aa2f2c9e91f08cfbafd2d1e3730d2419d317", size = 11706915, upload-time = "2026-07-10T03:08:51.028Z" }, + { url = "https://files.pythonhosted.org/packages/96/e1/929eda9cc72a9afe39a03c76f946a503508d37343cc8ff2e64226afda105/ty-0.0.58-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:79deb7bb4e5b3a1eee6ab9abc724d6ce3559d4977982707f310a139ee11fc703", size = 11532079, upload-time = "2026-07-10T03:08:53.771Z" }, + { url = "https://files.pythonhosted.org/packages/07/43/ebc58b3fc7d86a7abba2829f1674f7d4ae3a08f9794c1f31b707950c871f/ty-0.0.58-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5a28af3187e661708a386d44a4fc32896a5f589fb07b734a11ab2f516e7572b7", size = 11092983, upload-time = "2026-07-10T03:08:56.025Z" }, + { url = "https://files.pythonhosted.org/packages/92/6e/9547dbb8e51e47749cfb721a02b4fc862f9a932fa0f66a34a4d6dc429bb1/ty-0.0.58-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21a6977e34bc362fb378add46e59d5d56331c1c36727e6904767217ca8479718", size = 11490492, upload-time = "2026-07-10T03:08:58.49Z" }, + { url = "https://files.pythonhosted.org/packages/d9/76/9f83b51b5e7795d6c8d76b4bb1bb7cebf4c10d609e846c02ab138e404556/ty-0.0.58-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3ac23e6bf6105ceca46632debf1b10b98125aaf60202aeae02f6abfeea242b3d", size = 11503696, upload-time = "2026-07-10T03:09:00.741Z" }, + { url = "https://files.pythonhosted.org/packages/47/9d/9fd48a0696c680f74e50f31cd54e524eeb58c97ea9bb1c3b8e04230ba215/ty-0.0.58-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb6df6a8c6a21894807a49851370ec7fc64aa910296c78ada31db0ef19359112", size = 12158653, upload-time = "2026-07-10T03:09:02.998Z" }, + { url = "https://files.pythonhosted.org/packages/bc/ea/b5de845d2d8edae04d901c7585af7f04a057e18b26311f7fa4ca62b2da30/ty-0.0.58-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9df5847eebc026cde088b44420a03f7c6c169a7db747176bdf0a656eb1144713", size = 12723019, upload-time = "2026-07-10T03:09:05.291Z" }, + { url = "https://files.pythonhosted.org/packages/17/1c/54083b23eeff1e101f50b6df6a2c7f1e14b31abe0577c91bcae9e2c9395d/ty-0.0.58-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:53a331a7f1f85872c810676a0f16096ef98c1b95c8c9a573fe7fde64d0a93e7c", size = 12275715, upload-time = "2026-07-10T03:09:07.564Z" }, + { url = "https://files.pythonhosted.org/packages/22/88/16925434b06faa49d36aa7e7508a6821ec6feacb429ca2fd80a3d52716b4/ty-0.0.58-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb0b05cd479fdcedc2e6781d376ee1a33569f37ae7f58357004635f615c4374c", size = 12033075, upload-time = "2026-07-10T03:09:10.222Z" }, + { url = "https://files.pythonhosted.org/packages/58/2b/b55708dd483982ae03d14da3667e3f0346cd384e11cca3dd3674a8b598c1/ty-0.0.58-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9a0012786077e5becbb6add9fe51eda1d4d36d249afd3ae6cd141d554af15ae3", size = 12367729, upload-time = "2026-07-10T03:09:12.338Z" }, + { url = "https://files.pythonhosted.org/packages/91/a3/99ad66652956408f7e9ac3db6b4a416199d773b6c073cf95b0eea126d340/ty-0.0.58-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4ede96d7f6d149156da254e784b062b817736b68d4c6d660555a3d02d96966fb", size = 11439798, upload-time = "2026-07-10T03:09:14.518Z" }, + { url = "https://files.pythonhosted.org/packages/ee/23/344ceed4fe02ed498711e1f4a47b6e311fb1e9c4fecc19d31894be7a3472/ty-0.0.58-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:47608e58f73901b989402e6f283249cda4c2314282ec368aa74ab61761c62bd5", size = 11512695, upload-time = "2026-07-10T03:09:16.852Z" }, + { url = "https://files.pythonhosted.org/packages/55/cf/3801831812c468f3fd0b3043a80f557a9aa90e6c27375763d7c3121e03f2/ty-0.0.58-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9757de17cc17e4c6bc26e18d4e26dea52ffee53d41a10d9087c6465e6ab12e2b", size = 11812253, upload-time = "2026-07-10T03:09:19.151Z" }, + { url = "https://files.pythonhosted.org/packages/7b/80/bce4f245787b77d1ec9feec7d9161eade5e01a77dbc132e016b24df83b0d/ty-0.0.58-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f3776d54c1d935fcb8f814bd58efba402c86c555f93e1144c59d087e7aa8b906", size = 12123918, upload-time = "2026-07-10T03:09:21.636Z" }, + { url = "https://files.pythonhosted.org/packages/46/00/bab3d6268e7e88c792bf7cdde81bd11b31aa587eaba75196502b729747c8/ty-0.0.58-py3-none-win32.whl", hash = "sha256:8f50ec0ac3b42baa4c75895dc367071dc86b00ab440d29fdc72c633286a94815", size = 11230897, upload-time = "2026-07-10T03:09:23.871Z" }, + { url = "https://files.pythonhosted.org/packages/9c/68/d9504c895864aaa84a840dce6ac7f8e681f6938be1882c8d4f60832dbe57/ty-0.0.58-py3-none-win_amd64.whl", hash = "sha256:de8847b3a65475ae4773bddd3126bfcf29f017e88967c4dcc9c75d743a4d3e5c", size = 12299376, upload-time = "2026-07-10T03:09:26.292Z" }, + { url = "https://files.pythonhosted.org/packages/26/04/c9847cb680b5fe8e1f7d7b483edd5cedcc29394496e7b8ed40d96be796ba/ty-0.0.58-py3-none-win_arm64.whl", hash = "sha256:7334bb38789878f60677f2eb9c1de4bfdf4583e2443790989c77da9b10fe0989", size = 11710495, upload-time = "2026-07-10T03:09:28.478Z" }, ] [[package]] From 31fa5c1cf3c908fa71021da9018b36bee2b64a39 Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Fri, 10 Jul 2026 13:58:28 +0200 Subject: [PATCH 2/3] Fix flaky test --- nucliadb/tests/nucliadb/integration/search/test_search.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nucliadb/tests/nucliadb/integration/search/test_search.py b/nucliadb/tests/nucliadb/integration/search/test_search.py index 610c9c3092..2ae2e93575 100644 --- a/nucliadb/tests/nucliadb/integration/search/test_search.py +++ b/nucliadb/tests/nucliadb/integration/search/test_search.py @@ -225,7 +225,6 @@ def broker_resource_with_classifications(standalone_knowledgebox): c1.label = "label1" c1.labelset = "labelset1" fcm.metadata.metadata.classifications.append(c1) - bm.field_metadata.append(fcm) c2 = rpb.Classification() c2.label = "label2" @@ -252,10 +251,6 @@ def broker_resource_with_classifications(standalone_knowledgebox): return bm -# FIXME: for some reason, paragraph search here doesn't return any result -# sometimes, although the resource seems to be properly indexed and synced in -# nidx. Further debugging is needed -@pytest.mark.flaky(reruns=5) @pytest.mark.deploy_modes("standalone") async def test_search_returns_labels( nucliadb_search: AsyncClient, nucliadb_ingest_grpc: WriterStub, standalone_knowledgebox @@ -268,6 +263,7 @@ async def test_search_returns_labels( ) assert resp.status_code == 200 content = resp.json() + assert content["paragraphs"]["results"] par = content["paragraphs"]["results"][0] assert set(par["labels"]) == {"labelset1/label2", "labelset1/label1"} From a7aa2d56f323d68fd11b7574f1e97b2b10bec4b3 Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Fri, 10 Jul 2026 14:06:57 +0200 Subject: [PATCH 3/3] fix_test --- nucliadb/tests/ingest/unit/orm/test_resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nucliadb/tests/ingest/unit/orm/test_resource.py b/nucliadb/tests/ingest/unit/orm/test_resource.py index f6fc127590..1a739d3fd9 100644 --- a/nucliadb/tests/ingest/unit/orm/test_resource.py +++ b/nucliadb/tests/ingest/unit/orm/test_resource.py @@ -315,13 +315,15 @@ async def test_apply_fields_calls_update_all_field_ids(txn, storage, kb, rid): resource = Resource(txn, storage, kb, rid) resource.update_all_field_ids = AsyncMock() resource.set_field = AsyncMock() + resource.delete_field = AsyncMock() + resource.set_file_field_md5 = AsyncMock() bm = MagicMock() bm.texts = {"text": MagicMock()} bm.links = {"link": MagicMock()} bm.files = {"file": MagicMock()} bm.conversations = {"conversation": MagicMock()} - bm.delete_fields.append(FieldID(field_type=FieldType.CONVERSATION, field="to_delete")) + bm.delete_fields = [FieldID(field_type=FieldType.CONVERSATION, field="to_delete")] await resource.apply_field_values(bm)