From b1c70f024eca7bc424a4e715e5e9e61260eee015 Mon Sep 17 00:00:00 2001 From: Michele Pangrazzi Date: Thu, 19 Dec 2024 11:07:25 +0100 Subject: [PATCH] Remove deprecated NoneType import and use type(None) --- tests/test_handle_callable_type.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_handle_callable_type.py b/tests/test_handle_callable_type.py index 529b6cf..1b68b24 100644 --- a/tests/test_handle_callable_type.py +++ b/tests/test_handle_callable_type.py @@ -1,5 +1,4 @@ from collections.abc import Callable as CallableABC -from types import NoneType from typing import Any, Callable, Optional, Union import haystack @@ -20,7 +19,7 @@ (str, False), (Any, False), (Union[int, str], False), - (Optional[Callable[[haystack.dataclasses.streaming_chunk.StreamingChunk], NoneType]], True), + (Optional[Callable[[haystack.dataclasses.streaming_chunk.StreamingChunk], type(None)]], True), ], ) def test_is_callable_type(t, expected): @@ -33,7 +32,7 @@ def test_skip_callables_when_creating_pipeline_models(): "generator": { "system_prompt": {"type": Optional[str], "is_mandatory": False, "default_value": None}, "streaming_callback": { - "type": Optional[Callable[[haystack.dataclasses.streaming_chunk.StreamingChunk], NoneType]], + "type": Optional[Callable[[haystack.dataclasses.streaming_chunk.StreamingChunk], type(None)]], "is_mandatory": False, "default_value": None, },