From ff0d65bee4059f697b720fded9759520bffaae11 Mon Sep 17 00:00:00 2001 From: Aman Sachan Date: Thu, 18 Jun 2026 00:03:48 +0000 Subject: [PATCH] fix: correct post_call typevar in annotate_logs overload + docstring typos - In the 'Instance False, Requested True, Provided True' overload of annotate_logs, post_call used PostCall[S2, P2] while all 21 other overloads and the implementation signature use PostCall[S2, P3]. This was inconsistent with the rest of the type signature and broke type hinting for that specific overload. - Fix two docstring typos in plugins.py: 'excaption' -> 'exception' and 'fixs' -> 'fixes' in BasePlugin.uncaught_exception and RenamerPlugin/NameAdjusterPlugin __init__ docstrings. --- annotated_logger/__init__.py | 2 +- annotated_logger/plugins.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/annotated_logger/__init__.py b/annotated_logger/__init__.py index 06e84c4..8fb10fb 100644 --- a/annotated_logger/__init__.py +++ b/annotated_logger/__init__.py @@ -644,7 +644,7 @@ def annotate_logs( *, success_info: bool = True, # pragma: no mutate pre_call: PreCall[S2, P2] = None, - post_call: PostCall[S2, P2] = None, + post_call: PostCall[S2, P3] = None, _typing_self: Literal[False], _typing_requested: Literal[True], provided: Literal[True], diff --git a/annotated_logger/plugins.py b/annotated_logger/plugins.py index 5e857bf..a73ad54 100644 --- a/annotated_logger/plugins.py +++ b/annotated_logger/plugins.py @@ -24,7 +24,7 @@ def filter(self, _record: logging.LogRecord) -> bool: def uncaught_exception( self, exception: Exception, logger: AnnotatedAdapter ) -> AnnotatedAdapter: - """Handle an uncaught excaption.""" + """Handle an uncaught exception.""" if "success" not in logger.filter.annotations: logger.annotate(success=False) if "exception_title" not in logger.filter.annotations: @@ -68,7 +68,7 @@ class FieldNotPresentError(Exception): """Exception for a field that is supposed to be renamed, but is not present.""" def __init__(self, *, strict: bool = False, **kwargs: str) -> None: - """Store the list of names to rename and pre/post fixs.""" + """Store the list of names to rename and pre/post fixes.""" self.targets = kwargs self.strict = strict @@ -104,7 +104,7 @@ class NameAdjusterPlugin(BasePlugin): """Plugin that prevents name collisions with splunk field names.""" def __init__(self, names: list[str], prefix: str = "", postfix: str = "") -> None: - """Store the list of names to rename and pre/post fixs.""" + """Store the list of names to rename and pre/post fixes.""" self.names = names self.prefix = prefix self.postfix = postfix