Repository: modin-project/modin

Issue:
add tests for `read_orc`, `read_spss`, `json_normalize`, `read_xml`, `read_gbq`



Discussion:

Patch:
diff --git a/modin/pandas/io.py b/modin/pandas/io.py
--- a/modin/pandas/io.py
+++ b/modin/pandas/io.py
@@ -716,7 +716,7 @@ def to_pickle(
 @enable_logging
 def read_spss(
     path: Union[str, pathlib.Path],
-    usecols: Union[Sequence[str], type(None)] = None,
+    usecols: Optional[Sequence[str]] = None,
     convert_categoricals: bool = True,
 ):  # noqa: PR01, RT01, D200
     """
@@ -725,7 +725,9 @@ def read_spss(
     from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
 
     return DataFrame(
-        query_compiler=FactoryDispatcher.read_spss(path, usecols, convert_categoricals)
+        query_compiler=FactoryDispatcher.read_spss(
+            path=path, usecols=usecols, convert_categoricals=convert_categoricals
+        )
     )
 
 
@@ -761,7 +763,7 @@ def read_orc(
     Load an ORC object from the file path, returning a DataFrame.
     """
     ErrorMessage.default_to_pandas("read_orc")
-    return DataFrame(pandas.read_orc(path, columns, **kwargs))
+    return DataFrame(pandas.read_orc(path, columns=columns, **kwargs))
 
 
 @_inherit_docstrings(pandas.HDFStore)


Test patch:
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -11,6 +11,8 @@
 # ANY KIND, either express or implied. See the License for the specific language
 # governing permissions and limitations under the License.
 
+import unittest.mock as mock
+import inspect
 import contextlib
 import pytest
 import numpy as np
@@ -2487,6 +2489,17 @@ def test_to_gbq(self):
         ):
             modin_df.to_gbq("modin.table")
 
+    def test_read_gbq_mock(self):
+        test_args = ("fake_query",)
+        test_kwargs = inspect.signature(pd.read_gbq).parameters.copy()
+        test_kwargs.update(project_id="test_id", dialect="standart")
+        test_kwargs.pop("query", None)
+        with mock.patch(
+            "pandas.read_gbq", return_value=pandas.DataFrame([])
+        ) as read_gbq:
+            pd.read_gbq(*test_args, **test_kwargs)
+        read_gbq.assert_called_once_with(*test_args, **test_kwargs)
+
 
 class TestStata:
     def test_read_stata(self, make_stata_file):
@@ -2609,6 +2622,62 @@ def test_to_pickle(self):
             assert assert_files_eq(unique_filename_modin, unique_filename_pandas)
 
 
+class TestXml:
+    def test_read_xml(self):
+        # example from pandas
+        data = """<?xml version='1.0' encoding='utf-8'?>
+<data xmlns="http://example.com">
+ <row>
+   <shape>square</shape>
+   <degrees>360</degrees>
+   <sides>4.0</sides>
+ </row>
+ <row>
+   <shape>circle</shape>
+   <degrees>360</degrees>
+   <sides/>
+ </row>
+"""
+        eval_io("read_xml", path_or_buffer=data)
+
+
+class TestOrc:
+    # It's not easy to add infrastructure for `orc` format.
+    # In case of defaulting to pandas, it's enough
+    # to check that the parameters are passed to pandas.
+    def test_read_orc(self):
+        test_args = ("fake_path",)
+        test_kwargs = {"columns": ["A"], "fake_kwarg": "some_pyarrow_parameter"}
+        with mock.patch(
+            "pandas.read_orc", return_value=pandas.DataFrame([])
+        ) as read_orc:
+            pd.read_orc(*test_args, **test_kwargs)
+        read_orc.assert_called_once_with(*test_args, **test_kwargs)
+
+
+class TestSpss:
+    # It's not easy to add infrastructure for `spss` format.
+    # In case of defaulting to pandas, it's enough
+    # to check that the parameters are passed to pandas.
+    def test_read_spss(self):
+        test_args = ("fake_path", ["A"], False)
+        with mock.patch(
+            "pandas.read_spss", return_value=pandas.DataFrame([])
+        ) as read_spss:
+            pd.read_spss(*test_args)
+        read_spss.assert_called_once_with(*test_args)
+
+
+def test_json_normalize():
+    # example from pandas
+    data = [
+        {"id": 1, "name": {"first": "Coleen", "last": "Volk"}},
+        {"name": {"given": "Mark", "family": "Regner"}},
+        {"id": 2, "name": "Faye Raker"},
+    ]
+    eval_io("json_normalize", data=data)
+
+
 @pytest.mark.xfail(
     condition="config.getoption('--simulate-cloud').lower() != 'off'",
     reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",