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

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

11 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__all__ = [ 

9 "config", 

10 "detect_console_encoding", 

11 "get_option", 

12 "set_option", 

13 "reset_option", 

14 "describe_option", 

15 "option_context", 

16 "options", 

17 "using_copy_on_write", 

18] 

19from pandas._config import config 

20from pandas._config import dates # pyright: ignore # 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_copy_on_write(): 

34 _mode_options = _global_config["mode"] 

35 return _mode_options["copy_on_write"] and _mode_options["data_manager"] == "block" 

36 

37 

38def using_nullable_dtypes(): 

39 _mode_options = _global_config["mode"] 

40 return _mode_options["nullable_dtypes"]