Skip to content

Commit

Permalink
Remove deprecated NoneType import and use type(None)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpangrazzi committed Dec 19, 2024
1 parent 64e38ac commit b1c70f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_handle_callable_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections.abc import Callable as CallableABC
from types import NoneType
from typing import Any, Callable, Optional, Union

import haystack
Expand All @@ -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):
Expand All @@ -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,
},
Expand Down

0 comments on commit b1c70f0

Please sign in to comment.