Skip to content

Commit 995bf6a

Browse files
jrmylowpre-commit-ci[bot]
authored andcommitted
DOC: Updated docstring for set_option (pandas-dev#57235)
* Updated docstring and exceptions raised * updated code_checks.sh * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * testing fix for doc build --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2c4bd76 commit 995bf6a

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
136136
pandas.tseries.offsets.Milli\
137137
pandas.tseries.offsets.Micro\
138138
pandas.tseries.offsets.Nano\
139-
pandas.set_option\
140139
pandas.Timestamp.max\
141140
pandas.Timestamp.min\
142141
pandas.Timestamp.resolution\

pandas/_config/config.py

+16-9
Original file line numberDiff line numberDiff line change
@@ -326,30 +326,37 @@ def __doc__(self) -> str: # type: ignore[override]
326326
"""
327327

328328
_set_option_tmpl = """
329-
set_option(pat, value)
329+
set_option(*args, **kwargs)
330330
331-
Sets the value of the specified option.
331+
Sets the value of the specified option or options.
332332
333333
Available options:
334334
335335
{opts_list}
336336
337337
Parameters
338338
----------
339-
pat : str
340-
Regexp which should match a single option.
341-
Note: partial matches are supported for convenience, but unless you use the
342-
full option name (e.g. x.y.z.option_name), your code may break in future
343-
versions if new options with similar names are introduced.
344-
value : object
345-
New value of option.
339+
*args : str | object
340+
Arguments provided in pairs, which will be interpreted as (pattern, value)
341+
pairs.
342+
pattern: str
343+
Regexp which should match a single option
344+
value: object
345+
New value of option
346+
Note: partial pattern matches are supported for convenience, but unless you
347+
use the full option name (e.g. x.y.z.option_name), your code may break in
348+
future versions if new options with similar names are introduced.
349+
**kwargs : str
350+
Keyword arguments are not currently supported.
346351
347352
Returns
348353
-------
349354
None
350355
351356
Raises
352357
------
358+
ValueError if odd numbers of non-keyword arguments are provided
359+
TypeError if keyword arguments are provided
353360
OptionError if no such option exists
354361
355362
Notes

0 commit comments

Comments
 (0)