Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Updated docstring for set_option #57235

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.tseries.offsets.Milli\
pandas.tseries.offsets.Micro\
pandas.tseries.offsets.Nano\
pandas.set_option\
pandas.Timestamp.max\
pandas.Timestamp.min\
pandas.Timestamp.resolution\
Expand Down
25 changes: 16 additions & 9 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,30 +326,37 @@ def __doc__(self) -> str: # type: ignore[override]
"""

_set_option_tmpl = """
set_option(pat, value)
set_option(*args, **kwargs)
Sets the value of the specified option.
Sets the value of the specified option or options.
Available options:
{opts_list}
Parameters
----------
pat : str
Regexp which should match a single option.
Note: partial matches are supported for convenience, but unless you use the
full option name (e.g. x.y.z.option_name), your code may break in future
versions if new options with similar names are introduced.
value : object
New value of option.
*args : str | object
Arguments provided in pairs, which will be interpreted as (pattern, value)
pairs.
pattern: str
Regexp which should match a single option
value: object
New value of option
Note: partial pattern matches are supported for convenience, but unless you
use the full option name (e.g. x.y.z.option_name), your code may break in
future versions if new options with similar names are introduced.
**kwargs : str
Keyword arguments are not currently supported.
Returns
-------
None
Raises
------
ValueError if odd numbers of non-keyword arguments are provided
TypeError if keyword arguments are provided
OptionError if no such option exists
Notes
Expand Down
Loading