It seems that the NumPy maintainers decided it was best to not deprecate these conversions. It was:
Complained about in this issue: https://github.com/numpy/numpy/issues/23904
Resolved in this PR: https://github.com/numpy/numpy/pull/24193
And integrated into NumPy 2.0.0: https://numpy.org/doc/stable/release/2.0.0-notes.html#remove-datetime64-deprecation-warning-when-constructing-with-timezone
However, it hasn't hit v2.2's documentation: https://numpy.org/doc/2.2/reference/arrays.datetime.html#basic-datetimes
Mind you, a warning is still raised, just a UserWarning that datetime64 keeps no datetime information. So, to answer the question:
OK, so how do I avoid the warning? (Without giving up a significant performance factor)
import warnings
import numpy as np
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=UserWarning)
t = np.datetime64('2022-05-01T00:00:00-07:00') # np.datetime64 has no tz info