@@ -880,9 +880,9 @@ def __exit__(
880880 def _prepare_options (
881881 self ,
882882 options : FinalRequestOptions , # noqa: ARG002
883- ) -> None :
883+ ) -> FinalRequestOptions :
884884 """Hook for mutating the given options"""
885- return None
885+ return options
886886
887887 def _prepare_request (
888888 self ,
@@ -962,7 +962,7 @@ def _request(
962962 input_options = model_copy (options )
963963
964964 cast_to = self ._maybe_override_cast_to (cast_to , options )
965- self ._prepare_options (options )
965+ options = self ._prepare_options (options )
966966
967967 retries = self ._remaining_retries (remaining_retries , options )
968968 request = self ._build_request (options )
@@ -1457,9 +1457,9 @@ async def __aexit__(
14571457 async def _prepare_options (
14581458 self ,
14591459 options : FinalRequestOptions , # noqa: ARG002
1460- ) -> None :
1460+ ) -> FinalRequestOptions :
14611461 """Hook for mutating the given options"""
1462- return None
1462+ return options
14631463
14641464 async def _prepare_request (
14651465 self ,
@@ -1544,7 +1544,7 @@ async def _request(
15441544 input_options = model_copy (options )
15451545
15461546 cast_to = self ._maybe_override_cast_to (cast_to , options )
1547- await self ._prepare_options (options )
1547+ options = await self ._prepare_options (options )
15481548
15491549 retries = self ._remaining_retries (remaining_retries , options )
15501550 request = self ._build_request (options )
0 commit comments