Source: python-xarray Version: 2023.09.0-2 Severity: serious User: debian...@lists.debian.org Usertags: regression
Hi Maintainer There are new autopkgtest failures on s390x [1] which seem to be related to endianness, dtype('>M8[ns]') vs dtype('<M8[ns]'). I have copied one of the failures from the log below, but there are more. Regards Graham [1] https://ci.debian.net/packages/p/python-xarray/unstable/s390x/ 207s _ test_roundtrip_datetime64_nanosecond_precision[1677-09-21T00:12:43.145224193-ns-int64-20-True] _ 207s 207s timestr = '1677-09-21T00:12:43.145224193', timeunit = 'ns' 207s dtype = <class 'numpy.int64'>, fill_value = 20, use_encoding = True 207s 207s @pytest.mark.parametrize( 207s "timestr, timeunit, dtype, fill_value, use_encoding", 207s [ 207s ("1677-09-21T00:12:43.145224193", "ns", np.int64, 20, True), 207s ("1970-09-21T00:12:44.145224808", "ns", np.float64, 1e30, True), 207s ( 207s "1677-09-21T00:12:43.145225216", 207s "ns", 207s np.float64, 207s -9.223372036854776e18, 207s True, 207s ), 207s ("1677-09-21T00:12:43.145224193", "ns", np.int64, None, False), 207s ("1677-09-21T00:12:43.145225", "us", np.int64, None, False), 207s ("1970-01-01T00:00:01.000001", "us", np.int64, None, False), 207s ("1677-09-21T00:21:52.901038080", "ns", np.float32, 20.0, True), 207s ], 207s ) 207s def test_roundtrip_datetime64_nanosecond_precision( 207s timestr: str, 207s timeunit: str, 207s dtype: np.typing.DTypeLike, 207s fill_value: int | float | None, 207s use_encoding: bool, 207s ) -> None: 207s # test for GH7817 207s time = np.datetime64(timestr, timeunit) 207s times = [np.datetime64("1970-01-01T00:00:00", timeunit), np.datetime64("NaT"), time] 207s 207s if use_encoding: 207s encoding = dict(dtype=dtype, _FillValue=fill_value) 207s else: 207s encoding = {} 207s 207s var = Variable(["time"], times, encoding=encoding) 207s > assert var.dtype == np.dtype("<M8[ns]") 207s E AssertionError: assert dtype('>M8[ns]') == dtype('<M8[ns]') 207s E + where dtype('>M8[ns]') = <xarray.Variable (time: 3)>\narray(['1970-01-01T00:00:00.000000000', 'NaT',\n '1677-09-21T00:12:43.145224193'], dtype='datetime64[ns]').dtype 207s E + and dtype('<M8[ns]') = <class 'numpy.dtype'>('<M8[ns]') 207s E + where <class 'numpy.dtype'> = np.dtype