Skip to content

Commit e2fd822

Browse files
committed
check that keys are strings
1 parent a1a5846 commit e2fd822

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

neo/core/baseneo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def _check_annotations(value):
4646
raise ValueError(f"Invalid annotation. NumPy arrays with dtype {value.dtype.type}" f"are not allowed")
4747
elif isinstance(value, dict):
4848
for key, element in value.items():
49-
_check_annotations(key)
49+
if not isinstance(key, str):
50+
raise TypeError(f"Annotations keys must be strings not of type {type(key)}")
5051
_check_annotations(element)
5152
elif isinstance(value, (list, tuple)):
5253
for element in value:

0 commit comments

Comments
 (0)