pandas-dev/pandas-stubs

astype tests failing for `f16`, `float128`, `c32` and `complex256` on MacOS arm64 platforms

Closed this issue · 2 comments

Describe the bug

MacOS arm64 (M1 and above) platforms do not recognize some dtypes from

FAILED tests/test_series.py::test_astype_float['f16'-<class 'numpy.longdouble'>] - TypeError: data type 'f16' not understood
FAILED tests/test_series.py::test_astype_float['float128'-<class 'numpy.longdouble'>] - TypeError: data type 'float128' not understood
FAILED tests/test_series.py::test_astype_complex['c32'-<class 'numpy.clongdouble'>] - TypeError: data type 'c32' not understood
FAILED tests/test_series.py::test_astype_complex['complex256'-<class 'numpy.clongdouble'>] - TypeError: data type 'complex256' not understood

To Reproduce
Run poetry run poe test_all on a Mac M1 or above (for reference I ran a build on GitHub Actions, see https://github.com/loicdiridollou/pandas-stubs/actions/runs/11981847576/job/33408829929)

Please complete the following information:

  • OS: MacOS
  • OS Version 15
  • python version 3.10/3.11/3.12/3.13
  • version of type checker NA
  • version of installed pandas-stubs NA
Dr-Irv commented

This is pretty straightforward to fix. The tests in tests/test_series.py for those 4 types should be skipped at runtime if platform.processor() is arm

Ideally, we'd also have a Github action that would do tests on Mac ARM so this (and anything else) would be caught there.