Coverage for polypandas/protocols.py: 67%

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

2

3

4 def 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

18 def 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