Coverage for polypandas/protocols.py: 67%

12 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2026-02-24 14:21 -0500

1"""Protocol definitions and runtime checks for polypandas.""" 

2 

3 

4def is_pandas_available() -> bool: 

5 """Check if pandas is available at runtime. 

6 

7 Returns: 

8 True if pandas can be imported, False otherwise. 

9 """ 

10 try: 

11 import pandas # noqa: F401 

12 

13 return True 

14 except ImportError: 

15 return False 

16 

17 

18def is_pyarrow_available() -> bool: 

19 """Check if PyArrow is available at runtime. 

20 

21 Returns: 

22 True if pyarrow can be imported, False otherwise. 

23 """ 

24 try: 

25 import pyarrow # noqa: F401 

26 

27 return True 

28 except ImportError: 

29 return False