Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdks/python/apache_beam/typehints/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def from_typehints(element_type,
if not isinstance(element_type, NumpyTypeHint.NumpyTypeConstraint):
try:
element_type = NumpyArray[element_type, ()]
except TypeError as e:
# NumPy 2.4.6+ can also raise a value error if given a dtype that cannot
# be converted into a numpy dtype.
except (TypeError, ValueError) as e:
raise TypeError("Element type is not a dtype") from e

if not isinstance(batch_type, NumpyTypeHint.NumpyTypeConstraint):
Expand Down
Loading