@@ -244,7 +244,7 @@ def patch(self, modules: Tuple[str] = None):
244
244
245
245
def capture_lambda_handler (
246
246
self ,
247
- lambda_handler : Callable [[Dict , Any , Optional [Dict ]], Any ] = None ,
247
+ lambda_handler : Union [ Callable [[Dict , Any ], Any ], Callable [[ Dict , Any , Optional [Dict ]], Any ] ] = None ,
248
248
capture_response : Optional [bool ] = None ,
249
249
capture_error : Optional [bool ] = None ,
250
250
):
@@ -517,7 +517,7 @@ async def async_tasks():
517
517
518
518
def _decorate_async_function (
519
519
self ,
520
- method : Callable = None ,
520
+ method : Callable ,
521
521
capture_response : Optional [Union [bool , str ]] = None ,
522
522
capture_error : Optional [Union [bool , str ]] = None ,
523
523
method_name : str = None ,
@@ -544,7 +544,7 @@ async def decorate(*args, **kwargs):
544
544
545
545
def _decorate_generator_function (
546
546
self ,
547
- method : Callable = None ,
547
+ method : Callable ,
548
548
capture_response : Optional [Union [bool , str ]] = None ,
549
549
capture_error : Optional [Union [bool , str ]] = None ,
550
550
method_name : str = None ,
@@ -571,7 +571,7 @@ def decorate(*args, **kwargs):
571
571
572
572
def _decorate_generator_function_with_context_manager (
573
573
self ,
574
- method : Callable = None ,
574
+ method : Callable ,
575
575
capture_response : Optional [Union [bool , str ]] = None ,
576
576
capture_error : Optional [Union [bool , str ]] = None ,
577
577
method_name : str = None ,
@@ -599,7 +599,7 @@ def decorate(*args, **kwargs):
599
599
600
600
def _decorate_sync_function (
601
601
self ,
602
- method : Callable = None ,
602
+ method : Callable ,
603
603
capture_response : Optional [Union [bool , str ]] = None ,
604
604
capture_error : Optional [Union [bool , str ]] = None ,
605
605
method_name : str = None ,
@@ -654,20 +654,20 @@ def _add_response_as_metadata(
654
654
655
655
def _add_full_exception_as_metadata (
656
656
self ,
657
- method_name : str = None ,
658
- error : Exception = None ,
659
- subsegment : BaseSegment = None ,
657
+ method_name : str ,
658
+ error : Exception ,
659
+ subsegment : BaseSegment ,
660
660
capture_error : Optional [bool ] = None ,
661
661
):
662
662
"""Add full exception object as metadata for given subsegment
663
663
664
664
Parameters
665
665
----------
666
- method_name : str, optional
666
+ method_name : str
667
667
method name to add as metadata key, by default None
668
- error : Exception, optional
668
+ error : Exception
669
669
error to add as subsegment metadata, by default None
670
- subsegment : BaseSegment, optional
670
+ subsegment : BaseSegment
671
671
existing subsegment to add metadata on, by default None
672
672
capture_error : bool, optional
673
673
Do not include error as metadata, by default True
@@ -717,7 +717,7 @@ def __build_config(
717
717
service : str = None ,
718
718
disabled : bool = None ,
719
719
auto_patch : bool = None ,
720
- patch_modules : List = None ,
720
+ patch_modules : Union [ List , Tuple ] = None ,
721
721
provider : BaseProvider = None ,
722
722
):
723
723
""" Populates Tracer config for new and existing initializations """
0 commit comments