question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test failure with upstream-dev

See original GitHub issue

https://dev.azure.com/xarray/xarray/_build/results?buildId=1101&view=logs

=================================== FAILURES ===================================
_________________________ test_datetime_reduce[False] __________________________

dask = False

    @arm_xfail
    @pytest.mark.parametrize("dask", [False, True])
    def test_datetime_reduce(dask):
        time = np.array(pd.date_range("15/12/1999", periods=11))
        time[8:11] = np.nan
        da = DataArray(np.linspace(0, 365, num=11), dims="time", coords={"time": time})
    
        if dask and has_dask:
            chunks = {"time": 5}
            da = da.chunk(chunks)
    
        actual = da["time"].mean()
>       assert not pd.isnull(actual)
E       AssertionError: assert not True
E        +  where True = <function isna at 0x7f2475449ae8>(<xarray.DataArray 'time' ()>\narray('NaT', dtype='datetime64[ns]'))
E        +    where <function isna at 0x7f2475449ae8> = pd.isnull

xarray/tests/test_duck_array_ops.py:288: AssertionError
__________________________ test_datetime_reduce[True] __________________________

dask = True

    @arm_xfail
    @pytest.mark.parametrize("dask", [False, True])
    def test_datetime_reduce(dask):
        time = np.array(pd.date_range("15/12/1999", periods=11))
        time[8:11] = np.nan
        da = DataArray(np.linspace(0, 365, num=11), dims="time", coords={"time": time})
    
        if dask and has_dask:
            chunks = {"time": 5}
            da = da.chunk(chunks)
    
        actual = da["time"].mean()
>       assert not pd.isnull(actual)
E       AssertionError: assert not True
E        +  where True = <function isna at 0x7f2475449ae8>(<xarray.DataArray 'time' ()>\narray('NaT', dtype='datetime64[ns]'))
E        +    where <function isna at 0x7f2475449ae8> = pd.isnull

xarray/tests/test_duck_array_ops.py:288: AssertionError
=============================== warnings summary 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
crusaderkycommented, Oct 20, 2019

Narrowed down:

>>> import numpy as np
>>> a = np.array(['1999-12-15', 'NaT'], dtype='M8[ns]')
>>> np.min(a)

Output: numpy 1.17: numpy.datetime64('1999-12-15T00:00:00.000000000') numpy 1.18: numpy.datetime64('NaT')

triggered by: https://github.com/pydata/xarray/blob/0f7ab0e909d9b6272f734a0b6fa4318e9522d3a2/xarray/core/duck_array_ops.py#L372

1reaction
crusaderkycommented, Oct 20, 2019

Looking more closely at the failing tests, there are actually two problems. One is with pandas/numpy git tip, and it only affects the upstream-dev test suite. The other is with pseudonetcdf-3.1, and it affects py36, py37, and upstream-dev.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Git's "fatal: no upstream branch" error quickly example
Here's a quick fix for Git's "fatal: The current branch has no upstream branch" error, along with a brief explanation of why this...
Read more >
Smoke test failing on upstream devel branch of glusterfs #108
Smoke test failing for the following issue : gluster/glusterfs#1786 13:53:58 ERROR: Exception(glusterfs-2020.12.08-0.08.2308.el7.src.rpm) ...
Read more >
how to address Git error "the requested upstream branch ...
When I try the next step in the documentation ( git fetch upstream master:master ) I get the error message "fatal: Refusing to...
Read more >
Quickly Fix Git's "fatal: The current branch has no upstream ...
When you crate a new Git branch and want to push that branch to GitHub or GitLab, you'll get an error that says:...
Read more >
How to fix fatal:the current branch master has no upstream ...
The fatal: The current branch master has no upstream branch error occurs when you have not configured git in such a way that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found