Repository: modin-project/modin

Issue:
is_unique function implementation



Discussion:

Resolving patch:
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -1329,11 +1329,15 @@ def is_monotonic_increasing(df):
 
     @property
     def is_unique(self):
-        # We cannot default to pandas without a named function to call.
-        def is_unique(df):
-            return df.is_unique
+        """Check if Series has no duplicate values.
 
-        return self._default_to_pandas(is_unique)
+        Returns
+        -------
+        bool
+            True if there is no duplicates in Series, False otherwise.
+
+        """
+        return self.nunique(dropna=False) == len(self)
 
     @property
     def nbytes(self):


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
@@ -49,6 +49,7 @@
     bool_arg_values,
     int_arg_keys,
     int_arg_values,
+    encoding_types,
 )
 
 pd.DEFAULT_NPARTITIONS = 4
@@ -1611,8 +1612,7 @@ def test_is_monotonic_increasing(data):
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 def test_is_unique(data):
     modin_series, pandas_series = create_test_series(data)
-    with pytest.warns(UserWarning):
-        assert modin_series.is_unique == pandas_series.is_unique
+    assert modin_series.is_unique == pandas_series.is_unique
 
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
@@ -3617,3 +3617,32 @@ def test_str_isdecimal(data):
     else:
         modin_result = modin_series.str.isdecimal()
         df_equals(modin_result, pandas_result)
+
+
+@pytest.mark.parametrize("data", test_string_data_values, ids=test_string_data_keys)
+def test_casefold(data):
+    modin_series, pandas_series = create_test_series(data)
+
+    try:
+        pandas_result = pandas_series.str.casefold()
+    except Exception as e:
+        with pytest.raises(type(e)):
+            modin_series.str.casefold()
+    else:
+        modin_result = modin_series.str.casefold()
+        df_equals(modin_result, pandas_result)
+
+
+@pytest.mark.parametrize("encoding_type", encoding_types)
+@pytest.mark.parametrize("data", test_string_data_values, ids=test_string_data_keys)
+def test_encode(data, encoding_type):
+    modin_series, pandas_series = create_test_series(data)
+
+    try:
+        pandas_result = pandas_series.str.encode(encoding=encoding_type)
+    except Exception as e:
+        with pytest.raises(type(e)):
+            modin_series.str.encode(encoding=encoding_type)
+    else:
+        modin_result = modin_series.str.encode(encoding=encoding_type)
+        df_equals(modin_result, pandas_result)
diff --git a/modin/pandas/test/utils.py b/modin/pandas/test/utils.py
--- a/modin/pandas/test/utils.py
+++ b/modin/pandas/test/utils.py
@@ -354,6 +354,21 @@
 json_short_bytes = BytesIO(json_short_string.encode(encoding="UTF-8"))
 
 
+# Text encoding types
+encoding_types = [
+    "ascii",
+    "utf_32",
+    "utf_32_be",
+    "utf_32_le",
+    "utf_16",
+    "utf_16_be",
+    "utf_16_le",
+    "utf_7",
+    "utf_8",
+    "utf_8_sig",
+]
+
+
 def df_equals(df1, df2):
     """Tests if df1 and df2 are equal.