Repository: modin-project/modin

Issue:
`count` requires data to be numeric

### Describe the problem
<!-- Describe the problem clearly here. -->
During a local test, I discovered a mismatch with pandas with the `count` operator. See code below.

### Source code / logs

```python
import modin.pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(0, 100, size=(100, 10)))
print(df.count) # works
df["col0"] = df["col0"].map(str)
print(df.count) # fails with error message below
```

Error logs:

```
In [6]: df.count()
---------------------------------------------------------------------------                                            
TypeError                                 Traceback (most recent call last)                                            
<ipython-input-6-3c9a60fd698f> in <module>                                                                             
----> 1 df.count()                                                                                                                                                                                                                             
~\software_sources\modin\modin\pandas\base.py in count(self, axis, level,
numeric_only)                                     748         axis =
self._get_axis_number(axis) if axis is not None else 0                                              
749         if numeric_only is not None and not numeric_only:                                                      
--> 750             self._validate_dtypes(numeric_only=True)                                                               
751                                                                                                                    
752         if level is not None:                                                                                                                                                                                                          
~\software_sources\modin\modin\pandas\dataframe.py in _validate_dtypes(self,
numeric_only)                                 2192         for t in self.dtypes:                                                                                     
2193             if numeric_only and not is_numeric_dtype(t):                                                       
-> 2194                 raise TypeError("{0} is not a numeric data type".format(t))                                       
2195             elif not numeric_only and t != dtype:                                                                 
2196                 raise TypeError(                                                                                                                                                                                                       
TypeError: object is not a numeric data type  
```
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:

Resolving patch:
diff --git a/modin/pandas/base.py b/modin/pandas/base.py
--- a/modin/pandas/base.py
+++ b/modin/pandas/base.py
@@ -746,8 +746,8 @@ def count(self, axis=0, level=None, numeric_only=False):
         """
 
         axis = self._get_axis_number(axis) if axis is not None else 0
-        if numeric_only is not None and not numeric_only:
-            self._validate_dtypes(numeric_only=True)
+        if numeric_only is not None and numeric_only:
+            self._validate_dtypes(numeric_only=numeric_only)
 
         if level is not None:
             if not isinstance(self.axes[axis], pandas.MultiIndex):


Test patch: