Skip to content

Commit 4502bf0

Browse files
authored
Merge pull request #610 from Labelbox/jtso/fixnumpy
fixing the import path since numpy did an update on 6/22/22
2 parents eacadad + e44a74b commit 4502bf0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

labelbox/data/annotation_types/types.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ def validate(cls, val, field: ModelField):
3636
return val
3737

3838

39-
if version.parse(np.__version__) >= version.parse('1.22.0'):
39+
if version.parse(np.__version__) >= version.parse('1.23.0'):
40+
from numpy._typing import _GenericAlias
41+
TypedArray = _GenericAlias(_TypedArray, (Any, DType))
42+
elif version.parse('1.22.0') <= version.parse(
43+
np.__version__) < version.parse('1.23.0'):
4044
from numpy.typing import _GenericAlias
4145
TypedArray = _GenericAlias(_TypedArray, (Any, DType))
4246
else:
43-
TypedArray = _TypedArray[Any, DType]
47+
TypedArray = _TypedArray[Any, DType]

0 commit comments

Comments
 (0)