Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with numpy 1.14.0 #232

Open
FRidh opened this issue Jan 7, 2018 · 2 comments
Open

Test failures with numpy 1.14.0 #232

FRidh opened this issue Jan 7, 2018 · 2 comments

Comments

@FRidh
Copy link

FRidh commented Jan 7, 2018

________________________________ test_validate _________________________________

    def test_validate():
        assert validate(int, 1)
>       assert validate('int', 1)
E       AssertionError: assert False
E        +  where False = validate('int', 1)

datashape/tests/test_user.py:8: AssertionError
___________________________ test_nested_iteratables ____________________________

    def test_nested_iteratables():
>       assert validate('2 * 3 * int', [(1, 2, 3), (4, 5, 6)])
E       AssertionError: assert False
E        +  where False = validate('2 * 3 * int', [(1, 2, 3), (4, 5, 6)])

datashape/tests/test_user.py:19: AssertionError
_____________________________ test_validate_dicts ______________________________

    def test_validate_dicts():
>       assert validate('{x: int, y: int}', {'x': 1, 'y': 2})
E       AssertionError: assert False
E        +  where False = validate('{x: int, y: int}', {'x': 1, 'y': 2})

datashape/tests/test_user.py:26: AssertionError
________________________ test_tuples_can_be_records_too ________________________

    def test_tuples_can_be_records_too():
>       assert validate('{x: int, y: real}', (1, 2.0))
E       AssertionError: assert False
E        +  where False = validate('{x: int, y: real}', (1, 2.0))

datashape/tests/test_user.py:36: AssertionError
  • datashape 0.5.4
  • Python 2.7 and 3.6
@mingwandroid
Copy link

Does anyone know anything about this failure?

mingwandroid added a commit to AnacondaRecipes/datashape-feedstock that referenced this issue Apr 29, 2018
Due to: blaze/datashape#232

.. I picked 1.11 since astropy needs that so we will already have it.
mingwandroid added a commit to AnacondaRecipes/aggregate that referenced this issue Apr 29, 2018
Due to: blaze/datashape#232

.. I picked 1.11 since astropy needs that so we will already have it.
@kglowinski
Copy link
Contributor

It has to do with changes in numpy in 1.14.0+: https://github.com/numpy/numpy/blob/master/doc/release/1.14.0-notes.rst#future-changes

In particular:

np.issubdtype will stop downcasting dtype-like arguments. It might be expected that issubdtype(np.float32, 'float64') and issubdtype(np.float32, np.float64) mean the same thing - however, there was an undocumented special case that translated the former into issubdtype(np.float32, np.floating), giving the surprising result of True.

This means that all the validate tests are now just meaningless for what they were testing with 'int'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants