Repository: modin-project/modin
Pull request: TEST-#4366: Added regression test

## What do these changes do?

<!-- Please give a short brief about these changes. -->

- [x] commit message follows format outlined [here](https://modin.readthedocs.io/en/latest/development/contributing.html#commit-message-formatting)
- [x] passes `flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] passes `black --check modin/ asv_bench/benchmarks scripts/doc_checker.py`
- [x] signed commit with `git commit -s` <!-- you can amend your commit with a signature via `git commit -amend -s` -->
- [ ] Resolves #4366 <!-- issue must be created for each patch -->
- [x] tests added and passing
- [ ] module layout described at `docs/development/architecture.rst` is up-to-date <!-- if you have added, renamed or removed files or directories please update the documentation accordingly -->
- [ ] added (Issue Number: PR title (PR Number)) and github username to release notes for next major release <!-- e.g. DOCS-#4077: Add release notes template to docs folder (#4078) -->


Problem statement:
Don't correctly work `dtype` for `column` in `exchange df_protocol` for OmniSci
If we run:
```
import modin.pandas as pd
from modin.test.exchange.dataframe_protocol.omnisci.utils import split_df_into_chunks
import modin.config as cfg
cfg.StorageFormat.put('omnisci')

pd_df = pd.DataFrame({"a": pd.Categorical(list("testdataforexchangedataframeprotocol"))})
pd_chunks = split_df_into_chunks(pd_df, 2)
md_df = pd.concat(pd_chunks)
print(" ")
print("md_df.dtype = ", md_df["a"].dtype)
protocol_df = md_df.__dataframe__()
df_col = protocol_df.get_column_by_name(" ")
print("protocol_df.num_chunks() = ", df_col.num_chunks())
print("protocol_df.dtype = ", df_col.dtype)
```
We have result:
```
md_df.dtype =  category
protocol_df.num_chunks() =  2
protocol_df.dtype =  (<DTypeKind.INT: 0>, 64, 'l', '=')
```
This is because when converting df from an arrow table, the index column replaces the actual null column.

Hints from issue discussion:
This issue seems to be fixed by #4834.
@AndreyPavlenko, does the example above pass with those changes on your side?
> @AndreyPavlenko, does the example above pass with those changes on your side?

The example above seems not valid - it fails with KeyError. I've fixed the error by replacing get_column_by_name(" ") with get_column_by_name("a"). After that, I could reproduce the issue on the master branch. After applying the fix #4834, I'm getting the following output and it seems valid:

md_df.dtype =  category
protocol_df.num_chunks() =  2
protocol_df.dtype =  (<DTypeKind.CATEGORICAL: 23>, 8, 'c', '=')
Would you add a test in `modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py` so we can close this issue?

Commit message: TEST-#4366: Added regression test

Signed-off-by: Andrey Pavlenko <andrey.a.pavlenko@gmail.com>

Patch to review:
diff --git a/modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py b/modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py
index d0f202f272a..ccb0e14b0b1 100644
--- a/modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py
+++ b/modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py
@@ -310,3 +310,16 @@ def test_buffer_of_chunked_at(data_has_nulls, n_chunks):
         # Catch exception on attempt of doing a copy due to chunks combining
         with pytest.raises(RuntimeError):
             col.get_buffers()
+
+
+def test_concat_chunks():
+    """Regression test for https://github.com/modin-project/modin/issues/4366"""
+    pd_df = pd.DataFrame(
+        {"a": pd.Categorical(list("testdataforexchangedataframeprotocol"))}
+    )
+    pd_chunks = split_df_into_chunks(pd_df, 2)
+    md_df = pd.concat(pd_chunks)
+    assert md_df["a"].dtype.name == "category"
+    protocol_df = md_df.__dataframe__()
+    df_col = protocol_df.get_column_by_name("a")
+    assert df_col.num_chunks() == 2


Code review comments:
diff_hunk: @@ -310,3 +310,16 @@ def test_buffer_of_chunked_at(data_has_nulls, n_chunks):
         # Catch exception on attempt of doing a copy due to chunks combining
         with pytest.raises(RuntimeError):
             col.get_buffers()
+
+
+def test_concat_chunks():
+    """Regression test for https://github.com/modin-project/modin/issues/4366"""
+    pd_df = pd.DataFrame(
+        {"a": pd.Categorical(list("testdataforexchangedataframeprotocol"))}
+    )
+    pd_chunks = split_df_into_chunks(pd_df, 2)
+    md_df = pd.concat(pd_chunks)
+    assert md_df["a"].dtype.name == "category"
+    protocol_df = md_df.__dataframe__()
+    df_col = protocol_df.get_column_by_name("a")
+    assert df_col.num_chunks() == 2
path: modin/test/interchange/dataframe_protocol/omnisci/test_protocol.py
text: @user1:
```suggestion
    modin_df = pd.DataFrame(
        {"a": pd.Categorical(list("testdataforexchangedataframeprotocol"))}
    )
    n_chunks = 2
    chunks = split_df_into_chunks(modin_df, n_chunks)
    new_modin_df = pd.concat(chunks)
    assert new_modin_df["a"].dtype.name == "category"
    protocol_df = new_modin_df.__dataframe__()
    df_col = protocol_df.get_column_by_name("a")
    assert df_col.num_chunks() == n_chunks
```