Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/pandas/_config/__init__.py: 73%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

15 statements  

1""" 

2pandas._config is considered explicitly upstream of everything else in pandas, 

3should have no intra-pandas dependencies. 

4 

5importing `dates` and `display` ensures that keys needed by _libs 

6are initialized. 

7""" 

8 

9__all__ = [ 

10 "config", 

11 "describe_option", 

12 "detect_console_encoding", 

13 "get_option", 

14 "option_context", 

15 "options", 

16 "reset_option", 

17 "set_option", 

18] 

19from pandas._config import config 

20from pandas._config import dates # pyright: ignore[reportUnusedImport] # noqa: F401 

21from pandas._config.config import ( 

22 _global_config, 

23 describe_option, 

24 get_option, 

25 option_context, 

26 options, 

27 reset_option, 

28 set_option, 

29) 

30from pandas._config.display import detect_console_encoding 

31 

32 

33def using_string_dtype() -> bool: 

34 _mode_options = _global_config["future"] 

35 return _mode_options["infer_string"] 

36 

37 

38def using_python_scalars() -> bool: 

39 _mode_options = _global_config["future"] 

40 return _mode_options["python_scalars"] 

41 

42 

43def is_nan_na() -> bool: 

44 _mode_options = _global_config["future"] 

45 return not _mode_options["distinguish_nan_and_na"]