Repository: modin-project/modin

Issue:
TypeError: 'StringMethods' object is not subscriptable
The issue from here ([link](https://stackoverflow.com/questions/65413430/pandas-string-subscripting-does-not-work-in-modin-and-related-questions-about-c)).


Discussion:
One more source ([link](https://stackoverflow.com/questions/65474844/str0z-works-with-pandas-but-not-with-modin-typeerror-stringmethods-object/65475045#65475045)).
Came across the same question and wanted to follow up after 6 months?
Let's get this fixed for the next release @YarShev 
@devin-petersohn , we can fix this just by using default to pandas. I think it's enough for now. I'll take it.

Resolving patch:
diff --git a/modin/backends/base/query_compiler.py b/modin/backends/base/query_compiler.py
--- a/modin/backends/base/query_compiler.py
+++ b/modin/backends/base/query_compiler.py
@@ -3884,6 +3884,10 @@ def str_wrap(self, width, **kwargs):
     def str_zfill(self, width):
         return StrDefault.register(pandas.Series.str.zfill)(self, width)
 
+    @doc_utils.doc_str_method(refer_to="__getitem__", params="key : object")
+    def str___getitem__(self, key):
+        return StrDefault.register(pandas.Series.str.__getitem__)(self, key)
+
     # End of Str methods
 
     # Rolling methods
diff --git a/modin/backends/pandas/query_compiler.py b/modin/backends/pandas/query_compiler.py
--- a/modin/backends/pandas/query_compiler.py
+++ b/modin/backends/pandas/query_compiler.py
@@ -1400,6 +1400,7 @@ def stack(self, level, dropna):
     str_upper = MapFunction.register(_str_map("upper"), dtypes="copy")
     str_wrap = MapFunction.register(_str_map("wrap"), dtypes="copy")
     str_zfill = MapFunction.register(_str_map("zfill"), dtypes="copy")
+    str___getitem__ = MapFunction.register(_str_map("__getitem__"), dtypes="copy")
 
     # END String map partitions operations
 
diff --git a/modin/pandas/series_utils.py b/modin/pandas/series_utils.py
--- a/modin/pandas/series_utils.py
+++ b/modin/pandas/series_utils.py
@@ -427,6 +427,9 @@ def isnumeric(self):
     def isdecimal(self):
         return Series(query_compiler=self._query_compiler.str_isdecimal())
 
+    def __getitem__(self, key):
+        return Series(query_compiler=self._query_compiler.str___getitem__(key))
+
     def _default_to_pandas(self, op, *args, **kwargs):
         """
         Convert `self` to pandas type and call a pandas str.`op` on it.


Test patch:
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -3504,6 +3504,19 @@ def test_where():
     assert all(to_pandas(modin_result) == pandas_result)
 
 
+@pytest.mark.parametrize("data", test_string_data_values, ids=test_string_data_keys)
+@pytest.mark.parametrize(
+    "key",
+    [0, slice(0, len(test_string_data_values) / 2)],
+    ids=["single_key", "slice_key"],
+)
+def test_str___getitem__(data, key):
+    modin_series, pandas_series = create_test_series(data)
+    modin_result = modin_series.str[key]
+    pandas_result = pandas_series.str[key]
+    df_equals(modin_result, pandas_result)
+
+
 # Test str operations
 def test_str_cat():
     data = ["abC|DeF,Hik", "gSaf,qWer|Gre", "asd3,4sad|", np.NaN]