Skip to content

Commit 5278e73

Browse files
committed
revert
1 parent 5933df6 commit 5278e73

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

sdk/batch/azure-batch/azure/batch/_model_base.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)