Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI4OTI1Ni9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.29.1.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjMyODkxNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.29.2.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
# Otherwise, result are unexpected
self.additional_properties_detection = True

def __call__(self, target_obj, response_data, content_type=None):
def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements
"""Call the deserializer to process a REST response.

:param str target_obj: Target data type to deserialize to.
Expand All @@ -1415,6 +1415,27 @@ def __call__(self, target_obj, response_data, content_type=None):
:return: Deserialized object.
:rtype: object
"""
# Fast path for header deserialization: response_data is a plain str or None
# and target_obj is a simple scalar type. This avoids the expensive
# _unpack_content → _deserialize → _classify_target → deserialize_data chain.
if response_data is None:
return None
if target_obj == "str" and isinstance(response_data, str):
return response_data
if isinstance(response_data, str):
if target_obj == "int":
return int(response_data)
if target_obj == "bool":
if response_data in ("true", "1", "True"):
return True
if response_data in ("false", "0", "False"):
return False
return bool(response_data)
if target_obj == "rfc-1123":
return Deserializer.deserialize_rfc(response_data)
if target_obj == "bytearray":
return Deserializer.deserialize_bytearray(response_data)

data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)

Expand Down
Loading
Loading