@@ -1704,7 +1704,7 @@ def _is_scalar_access(self, key: Tuple):
1704
1704
if isinstance (ax , MultiIndex ):
1705
1705
return False
1706
1706
1707
- if isinstance (k , str ) and ax .is_all_dates :
1707
+ if isinstance (k , str ) and ax ._supports_partial_string_indexing :
1708
1708
# partial string indexing, df.loc['2000', 'A']
1709
1709
# should not be considered scalar
1710
1710
return False
@@ -1724,7 +1724,10 @@ def _get_partial_string_timestamp_match_key(self, key, labels):
1724
1724
"""Translate any partial string timestamp matches in key, returning the
1725
1725
new key (GH 10331)"""
1726
1726
if isinstance (labels , MultiIndex ):
1727
- if isinstance (key , str ) and labels .levels [0 ].is_all_dates :
1727
+ if (
1728
+ isinstance (key , str )
1729
+ and labels .levels [0 ]._supports_partial_string_indexing
1730
+ ):
1728
1731
# Convert key '2016-01-01' to
1729
1732
# ('2016-01-01'[, slice(None, None, None)]+)
1730
1733
key = tuple ([key ] + [slice (None )] * (len (labels .levels ) - 1 ))
@@ -1734,7 +1737,10 @@ def _get_partial_string_timestamp_match_key(self, key, labels):
1734
1737
# (..., slice('2016-01-01', '2016-01-01', None), ...)
1735
1738
new_key = []
1736
1739
for i , component in enumerate (key ):
1737
- if isinstance (component , str ) and labels .levels [i ].is_all_dates :
1740
+ if (
1741
+ isinstance (component , str )
1742
+ and labels .levels [i ]._supports_partial_string_indexing
1743
+ ):
1738
1744
new_key .append (slice (component , component , None ))
1739
1745
else :
1740
1746
new_key .append (component )
@@ -2339,7 +2345,7 @@ def convert_to_index_sliceable(obj, key):
2339
2345
2340
2346
# We might have a datetimelike string that we can translate to a
2341
2347
# slice here via partial string indexing
2342
- if idx .is_all_dates :
2348
+ if idx ._supports_partial_string_indexing :
2343
2349
try :
2344
2350
return idx ._get_string_slice (key )
2345
2351
except (KeyError , ValueError , NotImplementedError ):
0 commit comments