Skip to content

ENH: option to change the number in _dir_additions_for_owner #44335

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

Merged
merged 18 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
aee8dab
ENH: option to change the number in `__max_dir_additions`
KarstenNaert Nov 6, 2021
d9c311f
unittest for display.max_dir_items
KarstenNaert Nov 7, 2021
8ac71fd
add display.max_dir_items to docs
KarstenNaert Nov 7, 2021
fd85847
trim trailing whitespace
KarstenNaert Nov 7, 2021
ca36ecd
fix typo diplay -> display
KarstenNaert Nov 7, 2021
c66e7f1
Merge remote-tracking branch 'origin/master' into feature/max_dir_items
KarstenNaert Nov 7, 2021
26424f2
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 10, 2021
cab384d
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 11, 2021
b7c75fd
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 12, 2021
ec01193
Removed info about caching from options.rst
KarstenNaert Nov 13, 2021
1a97524
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 13, 2021
b86178e
Merge remote-tracking branch 'origin/master' into feature/max_dir_items
KarstenNaert Nov 15, 2021
5bd8336
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 15, 2021
9c0e8ff
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 16, 2021
090267e
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 18, 2021
31da398
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 20, 2021
634019c
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 22, 2021
2fb58b6
Merge remote-tracking branch 'upstream/master' into feature/max_dir_i…
KarstenNaert Nov 25, 2021
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
13 changes: 13 additions & 0 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ def use_numba_cb(key):
(default: True)
"""

pc_max_dir_items = """\
: int
The number of items that will be added to `dir(...)`. 'None' value means
unlimited. Because dir is cached, changing this option will not immediately
affect already existing dataframes until a column is deleted or added.

This is for instance used to suggest columns from a dataframe to tab
completion.
"""

pc_width_doc = """
: int
Width of the display in characters. In case python/IPython is running in
Expand Down Expand Up @@ -449,6 +459,9 @@ def _deprecate_negative_int_max_colwidth(key):
cf.register_option(
"html.use_mathjax", True, pc_html_use_mathjax_doc, validator=is_bool
)
cf.register_option(
"max_dir_items", 100, pc_max_dir_items, validator=is_nonnegative_int
)

tc_sim_interactive_doc = """
: boolean
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def _dir_additions_for_owner(self) -> set[str_t]:
"""
return {
c
for c in self.unique(level=0)[:100]
for c in self.unique(level=0)[: get_option("display.max_dir_items")]
if isinstance(c, str) and c.isidentifier()
}

Expand Down