Skip to content

Commit d703e8d

Browse files
committed
Add functools.wraps so we get some arg type hinting
1 parent 51af771 commit d703e8d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pydantic_evals/pydantic_evals/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import warnings
66
from collections.abc import Awaitable, Callable, Generator, Sequence
77
from contextlib import contextmanager
8-
from functools import partial
8+
from functools import partial, wraps
99
from pathlib import Path
1010
from typing import Any, TypeVar
1111

@@ -118,6 +118,7 @@ class LogfireNotConfiguredWarning(UserWarning):
118118
pass
119119

120120

121+
@wraps(_logfire.span)
121122
@contextmanager
122123
def logfire_span(*args: Any, **kwargs: Any) -> Generator[logfire_api.LogfireSpan, None, None]:
123124
"""Create a Logfire span without warning if logfire is not configured."""

pydantic_graph/pydantic_graph/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import warnings
66
from collections.abc import Callable, Generator
77
from contextlib import contextmanager
8-
from functools import partial
8+
from functools import partial, wraps
99
from typing import TYPE_CHECKING, Any, TypeAlias, TypeVar, get_args, get_origin
1010

1111
from logfire_api import Logfire, LogfireSpan
@@ -149,6 +149,7 @@ class LogfireNotConfiguredWarning(UserWarning):
149149
pass
150150

151151

152+
@wraps(_logfire.span)
152153
@contextmanager
153154
def logfire_span(*args: Any, **kwargs: Any) -> Generator[LogfireSpan, None, None]:
154155
"""Create a Logfire span without warning if logfire is not configured."""

0 commit comments

Comments
 (0)