File tree 2 files changed +9
-10
lines changed
2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -5439,8 +5439,10 @@ def _dir_additions(self) -> Set[str]:
5439
5439
add the string-like attributes from the info_axis.
5440
5440
If info_axis is a MultiIndex, it's first level values are used.
5441
5441
"""
5442
- additions = self ._info_axis ._dir_additions_for_owner
5443
- return super ()._dir_additions ().union (additions )
5442
+ additions = super ()._dir_additions ()
5443
+ if self ._info_axis ._can_hold_strings :
5444
+ additions &= self ._info_axis ._dir_additions_for_owner
5445
+ return additions
5444
5446
5445
5447
# ----------------------------------------------------------------------
5446
5448
# Consolidation of internals
Original file line number Diff line number Diff line change @@ -577,14 +577,11 @@ def _dir_additions_for_owner(self) -> Set[str_t]:
577
577
578
578
If this is a MultiIndex, it's first level values are used.
579
579
"""
580
- if self ._can_hold_strings :
581
- return {
582
- c
583
- for c in self .unique (level = 0 )[:100 ]
584
- if isinstance (c , str ) and c .isidentifier ()
585
- }
586
- else :
587
- return set ()
580
+ return {
581
+ c
582
+ for c in self .unique (level = 0 )[:100 ]
583
+ if isinstance (c , str ) and c .isidentifier ()
584
+ }
588
585
589
586
# --------------------------------------------------------------------
590
587
# Array-Like Methods
You can’t perform that action at this time.
0 commit comments