File tree Expand file tree Collapse file tree
sdk/batch/azure-batch/azure/batch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -821,22 +821,16 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
821821
822822 # is it optional?
823823 try :
824- if any (
825- a for a in annotation .__args__ if a == type (None )
826- ): # pyright: ignore # pylint: disable=unidiomatic-typecheck
824+ if any (a for a in annotation .__args__ if a == type (None )): # pyright: ignore # pylint: disable=unidiomatic-typecheck
827825 if len (annotation .__args__ ) <= 2 : # pyright: ignore
828826 if_obj_deserializer = _get_deserialize_callable_from_annotation (
829- next (a for a in annotation .__args__ if a != type (None )),
830- module ,
831- rf , # pyright: ignore # pylint: disable=unidiomatic-typecheck
827+ next (a for a in annotation .__args__ if a != type (None )), module , rf # pyright: ignore # pylint: disable=unidiomatic-typecheck
832828 )
833829
834830 return functools .partial (_deserialize_with_optional , if_obj_deserializer )
835831 # the type is Optional[Union[...]], we need to remove the None type from the Union
836832 annotation_copy = copy .copy (annotation )
837- annotation_copy .__args__ = [
838- a for a in annotation_copy .__args__ if a != type (None )
839- ] # pyright: ignore # pylint: disable=unidiomatic-typecheck
833+ annotation_copy .__args__ = [a for a in annotation_copy .__args__ if a != type (None )] # pyright: ignore # pylint: disable=unidiomatic-typecheck
840834 return _get_deserialize_callable_from_annotation (annotation_copy , module , rf )
841835 except AttributeError :
842836 pass
You can’t perform that action at this time.
0 commit comments