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

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

13 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 "describe_option", 

11 "detect_console_encoding", 

12 "get_option", 

13 "option_context", 

14 "options", 

15 "reset_option", 

16 "set_option", 

17] 

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

19from pandas._config.config import ( 

20 _global_config, 

21 describe_option, 

22 get_option, 

23 option_context, 

24 options, 

25 reset_option, 

26 set_option, 

27) 

28from pandas._config.display import detect_console_encoding 

29 

30 

31def using_string_dtype() -> bool: 

32 return _global_config["future"]["infer_string"] 

33 

34 

35def using_python_scalars() -> bool: 

36 return _global_config["future"]["python_scalars"] 

37 

38 

39def is_nan_na() -> bool: 

40 return not _global_config["future"]["distinguish_nan_and_na"] 

41 

42 

43def using_infer_freq_offset() -> bool | None: 

44 return _global_config["future"]["infer_freq_returns_offset"]