Skip to content

Commit 48aad38

Browse files
committed
fix: fix unbound variable and already defined error
1 parent 3204df1 commit 48aad38

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/cocoindex/typing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def analyze_type_info(t: Any) -> AnalyzedTypeInfo:
111111
Analyze a Python type and return the analyzed info.
112112
"""
113113
if isinstance(t, tuple) and len(t) == 2:
114-
key_type, value_type = t
115-
result = analyze_type_info(value_type)
116-
result.key_type = key_type
114+
kt, vt = t
115+
result = analyze_type_info(vt)
116+
result.key_type = kt
117117
return result
118118

119119
annotations: tuple[Annotation, ...] = ()
@@ -154,6 +154,7 @@ def analyze_type_info(t: Any) -> AnalyzedTypeInfo:
154154

155155
struct_type: type | None = None
156156
elem_type: ElementType | None = None
157+
key_type: type | None = None
157158
if _is_struct_type(t):
158159
struct_type = t
159160

0 commit comments

Comments
 (0)