Repository: modin-project/modin

Issue:
Enable test_reduce test on the HDK engine and add to ci
### Modin version checks

- [X] I have checked that this issue has not already been reported.

- [X] I have confirmed this bug exists on the latest released version of Modin.

- [X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow [this guide](https://modin.readthedocs.io/en/stable/getting_started/installation.html#installing-from-the-github-master-branch).)


### Reproducible Example

```python
Run test_reduce on the HDK engine.
```


### Issue Description

There are 6 failures, when the test is running on the HDK engine.

### Expected Behavior

All these failures should be fixed and the test added to CI.

### Error Logs

<details>

```python-traceback

Replace this line with the error backtrace (if applicable).

```

</details>


### Installed Versions

<details>

Replace this line with the output of pd.show_versions()

</details>



Discussion:

Resolving patch:
diff --git a/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py b/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py
--- a/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py
+++ b/modin/experimental/core/execution/native/implementations/hdk_on_native/calcite_serializer.py
@@ -349,7 +349,10 @@ def serialize_dtype(self, dtype):
             Serialized data type.
         """
         _warn_if_unsigned(dtype)
-        return {"type": self._DTYPE_STRINGS[dtype.name], "nullable": True}
+        try:
+            return {"type": self._DTYPE_STRINGS[dtype.name], "nullable": True}
+        except KeyError:
+            raise TypeError(f"Unsupported dtype: {dtype}")
 
     def serialize_input_idx(self, expr):
         """


Test patch:
diff --git a/modin/pandas/test/dataframe/conftest.py b/modin/pandas/test/dataframe/conftest.py
new file mode 100644
--- /dev/null
+++ b/modin/pandas/test/dataframe/conftest.py
@@ -0,0 +1,30 @@
+# Licensed to Modin Development Team under one or more contributor license agreements.
+# See the NOTICE file distributed with this work for additional information regarding
+# copyright ownership.  The Modin Development Team licenses this file to you under the
+# Apache License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under
+# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific language
+# governing permissions and limitations under the License.
+
+import pytest
+
+from modin.config import StorageFormat
+
+
+def pytest_collection_modifyitems(items):
+    if StorageFormat.get() == "Hdk":
+        for item in items:
+            if item.name in (
+                "test_sum[data0-over_rows_int-skipna_True-True]",
+                "test_sum[data0-over_rows_str-skipna_True-True]",
+            ):
+                item.add_marker(
+                    pytest.mark.xfail(
+                        reason="https://github.com/intel-ai/hdk/issues/286"
+                    )
+                )
diff --git a/modin/pandas/test/dataframe/test_reduce.py b/modin/pandas/test/dataframe/test_reduce.py
--- a/modin/pandas/test/dataframe/test_reduce.py
+++ b/modin/pandas/test/dataframe/test_reduce.py
@@ -15,6 +15,8 @@
 import numpy as np
 import pandas
 import matplotlib
+from pandas._testing import assert_series_equal
+
 import modin.pandas as pd
 
 from modin.pandas.test.utils import (
@@ -37,7 +39,7 @@
     test_data_large_categorical_dataframe,
     default_to_pandas_ignore_string,
 )
-from modin.config import NPartitions
+from modin.config import NPartitions, StorageFormat
 
 NPartitions.put(4)
 
@@ -434,8 +436,22 @@ def test_value_counts_categorical():
     data = np.array(["a"] * 50000 + ["b"] * 10000 + ["c"] * 1000)
     random_state = np.random.RandomState(seed=42)
     random_state.shuffle(data)
+    modin_df, pandas_df = create_test_dfs(
+        {"col1": data, "col2": data}, dtype="category"
+    )
+
+    if StorageFormat.get() == "Hdk":
+        # The order of HDK categories is different from Pandas
+        # and, thus, index comparison fails.
+        def comparator(df1, df2):
+            assert_series_equal(df1._to_pandas(), df2, check_index=False)
+
+    else:
+        comparator = df_equals
 
     eval_general(
-        *create_test_dfs({"col1": data, "col2": data}, dtype="category"),
+        modin_df,
+        pandas_df,
         lambda df: df.value_counts(),
+        comparator=comparator,
     )