Skip to content

Commit a153bf0

Browse files
fix: Fix potential NameError: parameter_map in convert_dataclass_to_schema() (regression introduced in 4.2.6)
1 parent 1496f83 commit a153bf0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[[entries]]
2+
id = "8a6d54b8-0898-465a-a34c-6d5b37dab337"
3+
type = "fix"
4+
description = "Fix potential `NameError: parameter_map` in `convert_dataclass_to_schema()` (regression introduced in 4.2.6)"
5+
author = "@NiklasRosenstein"

databind.core/src/databind/core/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,13 @@ class A(Generic[T]):
205205
fields: t.Dict[str, Field] = {}
206206
while queue:
207207
hint = queue.pop(0)
208+
parameter_map = hint.get_parameter_map()
208209

209210
if hint.type in eval_context_by_type:
210211
# Make sure forward references are resolved.
211212
hint = hint.evaluate(eval_context_by_type[hint.type]) # type: ignore[assignment]
212213
assert isinstance(hint, ClassTypeHint)
213214

214-
parameter_map = hint.get_parameter_map()
215-
216215
for field in dataclasses.fields(hint.type):
217216
if not field.init:
218217
# If we cannot initialize the field in the constructor, we should also

0 commit comments

Comments
 (0)