Skip to content

test: skip ibis test on unsupported python version - #3486

Merged
jonmmease merged 2 commits into
vega:mainfrom
dangotbanned:fix-ibis-test-warning
Jul 19, 2024
Merged

jonmmease merged 2 commits into
vega:mainfrom
dangotbanned:fix-ibis-test-warning

Conversation

@dangotbanned

@dangotbanned dangotbanned commented Jul 19, 2024 •

Copy link
Copy Markdown
Member

test_ibis_with_date_32 was always emitting the same warning on 3.8:

================================================================================================= warnings summary =================================================================================================  
tests/vegalite/v5/test_api.py::test_ibis_with_date_32   

/altair/altair/vegalite/v5/api.py:233: UserWarning: data of type <class 'ibis.expr.types.relations.Table'> not recognized
     warnings.warn(f"data of type {type(data)} not recognized", stacklevel=1)  

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 
==================================================================================== 210 passed, 1 xfailed, 1 warning in 17.92s ====================================================================================

@MarcoGorelli wanted to check in with you to see if this is a reasonable skip?

I was a little confused on the ibis.expr.types.relations.Table appearing on a python below their minimum

Always was emitting the same warning on `3.8`, `3.9`:

```
================================================================================================= warnings summary =================================================================================================  tests/vegalite/v5/test_api.py::test_ibis_with_date_32   /altair/altair/vegalite/v5/api.py:233: UserWarning: data of type <class 'ibis.expr.types.relations.Table'> not recognized     warnings.warn(f"data of type {type(data)} not recognized", stacklevel=1)  -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ==================================================================================== 210 passed, 1 xfailed, 1 warning in 17.92s ====================================================================================
```
@MarcoGorelli

Copy link
Copy Markdown
Contributor

Hi @dangotbanned !

I just tried installing altair from source on Python3.9, and this test runs fine for me without any warnings

Could you show where the warning is appearing please? Is it in a CI run?

@dangotbanned

dangotbanned commented Jul 19, 2024 •

Copy link
Copy Markdown
Member Author

Hi @dangotbanned !

I just tried installing altair from source on Python3.9, and this test runs fine for me without any warnings

Could you show where the warning is appearing please? Is it in a CI run?

@MarcoGorelli just looked through the CI runs and I can't seem to find any warnings.

I think this is win32 only, but for repro if you have access to windows:

>>> hatch test --python 3.8 -k test_ibis_with_date_32

───────────────────────────────────────────────────────────────────────────────────────────── hatch-test.py3.8 ─────────────────────────────────────────────────────────────────────────────────────────────
cmd [1] | ruff check .
All checks passed!
cmd [2] | ruff format --diff --check .
89 files already formatted
cmd [3] | mypy altair tests
Success: no issues found in 367 source files
cmd [4] | pytest -p no:randomly -n logical -k test_ibis_with_date_32
=========================================================================================== test session starts ===========================================================================================
platform win32 -- Python 3.8.19, pytest-8.2.2, pluggy-1.5.0
rootdir: C:\..\altair
configfile: pyproject.toml
plugins: anyio-4.4.0, cov-5.0.0, mock-3.14.0, rerunfailures-14.0, xdist-3.6.1
24 workers [1 item]       
x                                                                                                                                                                                                    [100%]
============================================================================================ warnings summary =============================================================================================
tests/vegalite/v5/test_api.py::test_ibis_with_date_32
  C:\..\altair\altair\vegalite\v5\api.py:233: UserWarning: data of type <class 'ibis.expr.types.relations.Table'> not recognized
    warnings.warn(f"data of type {type(data)} not recognized", stacklevel=1)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================================== 1 xfailed, 1 warning in 16.81s ======================================================================================

If you can confirm that you get the same on windows, I'll update the skipif to include that as a constraint

@MarcoGorelli

Copy link
Copy Markdown
Contributor

Sure but that's 3.8?

On 3.8, I can reproduce, even on Linux - the maximum Ibis version installable on Python 3.8 is Ibis 5.1.0, which didn't yet have the dataframe interchange protocol

I think just 3.8 needs skipping?

@dangotbanned

dangotbanned commented Jul 19, 2024 •

Copy link
Copy Markdown
Member Author

Sure but that's 3.8?

On 3.8, I can reproduce, even on Linux - the maximum Ibis version installable on Python 3.8 is Ibis 5.1.0, which didn't yet have the dataframe interchange protocol

I think just 3.8 needs skipping?

@MarcoGorelli you're right!

So it looks like just 3.8, and my assumption on sys.platform was unrelated

>>> hatch test --python 3.8 -k test_ibis_with_date_32

───────────────────────────────────────────────────────────────────────────────────────────── hatch-test.py3.8 ─────────────────────────────────────────────────────────────────────────────────────────────
cmd [1] | ruff check .
All checks passed!
cmd [2] | ruff format --diff --check .
89 files already formatted
cmd [3] | mypy altair tests
Success: no issues found in 367 source files
cmd [4] | pytest -p no:randomly -n logical -k test_ibis_with_date_32
=========================================================================================== test session starts ===========================================================================================
platform win32 -- Python 3.8.19, pytest-8.2.2, pluggy-1.5.0
rootdir: C:\..\altair
configfile: pyproject.toml
plugins: anyio-4.4.0, cov-5.0.0, mock-3.14.0, rerunfailures-14.0, xdist-3.6.1
24 workers [1 item]       
x                                                                                                                                                                                                    [100%]
============================================================================================ warnings summary =============================================================================================
tests/vegalite/v5/test_api.py::test_ibis_with_date_32
  C:\..\altair\altair\vegalite\v5\api.py:233: UserWarning: data of type <class 'ibis.expr.types.relations.Table'> not recognized
    warnings.warn(f"data of type {type(data)} not recognized", stacklevel=1)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================================== 1 xfailed, 1 warning in 16.81s ====================================================================================== 


>>> hatch test --python 3.9 -k test_ibis_with_date_32

───────────────────────────────────────────────────────────────────────────────────────────── hatch-test.py3.9 ─────────────────────────────────────────────────────────────────────────────────────────────
cmd [1] | ruff check .
All checks passed!
cmd [2] | ruff format --diff --check .
89 files already formatted
cmd [3] | mypy altair tests
Success: no issues found in 367 source files
cmd [4] | pytest -p no:randomly -n logical -k test_ibis_with_date_32
=========================================================================================== test session starts ===========================================================================================
platform win32 -- Python 3.9.19, pytest-8.2.2, pluggy-1.5.0
rootdir: C:\..\altair
configfile: pyproject.toml
plugins: anyio-4.4.0, cov-5.0.0, mock-3.14.0, rerunfailures-14.0, xdist-3.6.1
24 workers [1 item]       
x                                                                                                                                                                                                    [100%]
=========================================================================================== 1 xfailed in 16.43s ===========================================================================================


>>> hatch test --python 3.10 -k test_ibis_with_date_32

──────────────────────────────────────────────────────────────────────────────────────────── hatch-test.py3.10 ─────────────────────────────────────────────────────────────────────────────────────────────
cmd [1] | ruff check .
All checks passed!
cmd [2] | ruff format --diff --check .
89 files already formatted
cmd [3] | mypy altair tests
Success: no issues found in 367 source files
cmd [4] | pytest -p no:randomly -n logical -k test_ibis_with_date_32
=========================================================================================== test session starts ===========================================================================================
platform win32 -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: C:\..\altair
configfile: pyproject.toml
plugins: anyio-4.4.0, cov-5.0.0, mock-3.14.0, rerunfailures-14.0, xdist-3.6.1
24 workers [1 item]       
x                                                                                                                                                                                                    [100%]
=========================================================================================== 1 xfailed in 16.89s ===========================================================================================

@MarcoGorelli

Copy link
Copy Markdown
Contributor

Thanks for updating!

@MarcoGorelli wanted to check in with you to see if this is a reasonable skip?

fwiw, looks good to me!

@jonmmease

Copy link
Copy Markdown
Contributor

Thanks both!

@jonmmease
jonmmease merged commit 80939e7 into vega:main Jul 19, 2024
@dangotbanned
dangotbanned deleted the fix-ibis-test-warning branch July 19, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants