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

Only allow named extension array tests #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianthomas23
Copy link
Member

This is a possible (temporary?) fix to the problem of new pandas versions including new extension array tests that break our CI. The fix is to only run extension array tests with particular names, so the creation of a new test will not cause our existing CI to fail.

The solution isn't very elegant and I'm not sure I really like it, but it does fix the problem.

@ianthomas23
Copy link
Member Author

When you run pytest any extension array tests that are not included in the appropriate sequence are skipped as follows:

$ pytest spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface
========================================================= test session starts ==========================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0 -- /home/iant/.venv/sp/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/iant/github/spatialpandas/.hypothesis/examples')
rootdir: /home/iant/github/spatialpandas, configfile: tox.ini
plugins: cov-3.0.0, hypothesis-6.47.3
collected 14 items                                                                                                                     

spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_len PASSED                                          [  7%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_size PASSED                                         [ 14%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_ndim PASSED                                         [ 21%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_can_hold_na_valid PASSED                            [ 28%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_contains SKIPPED (Not in "only_run_named_tests")    [ 35%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_memory_usage PASSED                                 [ 42%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_array_interface PASSED                              [ 50%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_is_extension_array_dtype PASSED                     [ 57%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_no_values_attribute PASSED                          [ 64%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_is_numeric_honored PASSED                           [ 71%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_isna_extension_array PASSED                         [ 78%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_copy SKIPPED (Not in "only_run_named_tests")        [ 85%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_view SKIPPED (Not in "only_run_named_tests")        [ 92%]
spatialpandas/tests/test_fixedextensionarray.py::TestGeometryInterface::test_tolist PASSED                                       [100%]

=========================================================== warnings summary ===========================================================
spatialpandas/tests/test_fixedextensionarray.py: 11 warnings
  /home/iant/github/spatialpandas/spatialpandas/geometry/basefixed.py:111: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    array = np.asarray(array)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================== 11 passed, 3 skipped, 11 warnings in 0.47s ==============================================

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I'd be against something like this, but these are desperate times, and it does sound like it would address the underlying problem that new tests added upstream seem to have a very low probability of revealing genuine issues and a very high probability of breaking our builds. In the past couple of years I don't recall one of those tests revealing such a problem, but I do recall many, many breaks to our build. So I'm ok with holding our noses and putting this in place if you are!

@ianthomas23
Copy link
Member Author

@jbednar Maybe we hold off merging this for the moment and keep it in reserve whilst I fix the other CI problems.

@ianthomas23 ianthomas23 force-pushed the extension_array_test_inclusion branch from 4d46c03 to 88ce1f8 Compare July 27, 2022 13:33
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

Successfully merging this pull request may close these issues.

2 participants