@@ -1726,6 +1726,11 @@ def _is_scalar_access(self, key: Tuple):
17261726 if isinstance (ax , MultiIndex ):
17271727 return False
17281728
1729+ if isinstance (k , str ) and ax ._supports_partial_string_indexing :
1730+ # partial string indexing, df.loc['2000', 'A']
1731+ # should not be considered scalar
1732+ return False
1733+
17291734 if not ax .is_unique :
17301735 return False
17311736
@@ -1741,7 +1746,10 @@ def _get_partial_string_timestamp_match_key(self, key, labels):
17411746 """Translate any partial string timestamp matches in key, returning the
17421747 new key (GH 10331)"""
17431748 if isinstance (labels , MultiIndex ):
1744- if isinstance (key , str ) and labels .levels [0 ].is_all_dates :
1749+ if (
1750+ isinstance (key , str )
1751+ and labels .levels [0 ]._supports_partial_string_indexing
1752+ ):
17451753 # Convert key '2016-01-01' to
17461754 # ('2016-01-01'[, slice(None, None, None)]+)
17471755 key = tuple ([key ] + [slice (None )] * (len (labels .levels ) - 1 ))
@@ -1751,7 +1759,10 @@ def _get_partial_string_timestamp_match_key(self, key, labels):
17511759 # (..., slice('2016-01-01', '2016-01-01', None), ...)
17521760 new_key = []
17531761 for i , component in enumerate (key ):
1754- if isinstance (component , str ) and labels .levels [i ].is_all_dates :
1762+ if (
1763+ isinstance (component , str )
1764+ and labels .levels [i ]._supports_partial_string_indexing
1765+ ):
17551766 new_key .append (slice (component , component , None ))
17561767 else :
17571768 new_key .append (component )
@@ -2340,7 +2351,7 @@ def convert_to_index_sliceable(obj, key):
23402351
23412352 # We might have a datetimelike string that we can translate to a
23422353 # slice here via partial string indexing
2343- if idx .is_all_dates :
2354+ if idx ._supports_partial_string_indexing :
23442355 try :
23452356 return idx ._get_string_slice (key )
23462357 except (KeyError , ValueError , NotImplementedError ):
0 commit comments