Repository: modin-project/modin

Issue:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
Since we already have people using Python 3.9, we should change this.
```
modin\pandas\iterator.py:16
```


Discussion:
I have created https://github.com/modin-project/modin/pull/2641 to fix this. I have also fixed some deprecation warnings.
The change was delayed to Python 3.10 which will raise `ImportError` for importing ABC directly from collections.

Resolving patch:
diff --git a/modin/backends/pandas/parsers.py b/modin/backends/pandas/parsers.py
--- a/modin/backends/pandas/parsers.py
+++ b/modin/backends/pandas/parsers.py
@@ -248,14 +248,14 @@ def update_row_nums(match):
             """
             b = match.group(0)
             return re.sub(
-                b"\d+",  # noqa: W605
+                br"\d+",
                 lambda c: str(int(c.group(0).decode("utf-8")) - _skiprows).encode(
                     "utf-8"
                 ),
                 b,
             )
 
-        bytes_data = re.sub(b'r="[A-Z]*\d+"', update_row_nums, bytes_data)  # noqa: W605
+        bytes_data = re.sub(br'r="[A-Z]*\d+"', update_row_nums, bytes_data)
         bytesio = BytesIO(excel_header + bytes_data + footer)
         # Use openpyxl to read/parse sheet data
         reader = WorksheetReader(ws, bytesio, ex.shared_strings, False)
diff --git a/modin/pandas/iterator.py b/modin/pandas/iterator.py
--- a/modin/pandas/iterator.py
+++ b/modin/pandas/iterator.py
@@ -13,7 +13,7 @@
 
 """Place to define the Modin iterator."""
 
-from collections import Iterator
+from collections.abc import Iterator
 
 
 class PartitionIterator(Iterator):


Test patch:
diff --git a/stress_tests/kaggle/kaggle14.py b/stress_tests/kaggle/kaggle14.py
--- a/stress_tests/kaggle/kaggle14.py
+++ b/stress_tests/kaggle/kaggle14.py
@@ -50,7 +50,7 @@
 data["Initial"] = 0
 for i in data:
     data["Initial"] = data.Name.str.extract(
-        "([A-Za-z]+)\."  # noqa: W605
+        r"([A-Za-z]+)\."  # noqa: W605
     )  # lets extract the Salutations
 pd.crosstab(data.Initial, data.Sex).T.style.background_gradient(
     cmap="summer_r"
diff --git a/stress_tests/kaggle/kaggle4.py b/stress_tests/kaggle/kaggle4.py
--- a/stress_tests/kaggle/kaggle4.py
+++ b/stress_tests/kaggle/kaggle4.py
@@ -51,7 +51,7 @@ def ignore_warn(*args, **kwargs):
 (mu, sigma) = norm.fit(train["SalePrice"])
 print("\n mu = {:.2f} and sigma = {:.2f}\n".format(mu, sigma))
 plt.legend(
-    ["Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )".format(mu, sigma)],
+    [r"Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )".format(mu, sigma)],
     loc="best",  # noqa: W605
 )
 plt.ylabel("Frequency")
@@ -64,7 +64,7 @@ def ignore_warn(*args, **kwargs):
 (mu, sigma) = norm.fit(train["SalePrice"])
 print("\n mu = {:.2f} and sigma = {:.2f}\n".format(mu, sigma))
 plt.legend(
-    ["Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )".format(mu, sigma)],
+    [r"Normal dist. ($\mu=$ {:.2f} and $\sigma=$ {:.2f} )".format(mu, sigma)],
     loc="best",  # noqa: W605
 )
 plt.ylabel("Frequency")
diff --git a/stress_tests/kaggle/kaggle5.py b/stress_tests/kaggle/kaggle5.py
--- a/stress_tests/kaggle/kaggle5.py
+++ b/stress_tests/kaggle/kaggle5.py
@@ -53,7 +53,7 @@
 "After", train_df.shape, test_df.shape, combine[0].shape, combine[1].shape
 for dataset in combine:
     dataset["Title"] = dataset.Name.str.extract(
-        " ([A-Za-z]+)\.", expand=False
+        r" ([A-Za-z]+)\.", expand=False
     )  # noqa: W605
 pd.crosstab(train_df["Title"], train_df["Sex"])
 for dataset in combine: