unionai-oss / pandera

A light-weight, flexible, and expressive statistical data testing library
https://www.union.ai/pandera
MIT License
3.05k stars 281 forks source link

Error Importing Pandera with Polars extra #1590

Closed baldwinj30 closed 1 month ago

baldwinj30 commented 1 month ago

Describe the bug I get an error when importing pandera after installing the latest 0.19.0b2 version with the polars extra in a clean environment. I can import it successfully if I install without the polars extra.

Code Sample, a copy-pastable example

I installed pandera 0.19.0b2 in a clean virtual environment using pip install pandera[polars]==0.19.0b2 and attempted to import pandera:

import pandera as pa

I got the following error message:

>>> import pandera as pa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venv/lib/python3.11/site-packages/pandera/__init__.py", line 6, in <module>
    from pandera import errors, external_config, typing
  File ".venv/lib/python3.11/site-packages/pandera/external_config.py", line 23, in <module>
    import pyspark.pandas
ModuleNotFoundError: No module named 'pyspark'

Versions:

cosmicBboy commented 1 month ago

Good catch! https://github.com/unionai-oss/pandera/pull/1591 should fix this

cosmicBboy commented 1 month ago

Will cut a fresh beta release so you can continue testing :)