Repository: modin-project/modin

Issue:
`Series.apply` throws spurious error when operating over a Series of lists

### Describe the problem
<!-- Describe the problem clearly here. -->
The error gets thrown when doing an `apply` on a Series that has lists in the values:

```
  File "/mnt/c/Users/devin/software_sources/modin/modin/engines/ray/pandas_on_ray/frame/partition.py", line 206, in deploy_ray_func
    result = func(partition.copy(), **kwargs)
  File "/mnt/c/Users/devin/software_sources/modin/modin/data_management/functions/mapfunction.py", line 10, in <lambda>
    lambda x: function(x, *args, **kwargs), *call_args, **call_kwds
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 6994, in applymap
    return self.apply(infer)
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 6928, in apply
    return op.get_result()
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 186, in get_result
    return self.apply_standard()
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 292, in apply_standard
    self.apply_series_generator()
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/apply.py", line 321, in apply_series_generator
    results[i] = self.f(v)
  File "/home/devin/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 6992, in infer
    return lib.map_infer(x.astype(object).values, func)
  File "pandas/_libs/lib.pyx", line 2228, in pandas._libs.lib.map_infer
  File "/mnt/c/Users/devin/software_sources/modin/modin/pandas/series.py", line 694, in <lambda>
    lambda s: arg(s) if not pandas.isnull(s) or na_action is None else s
ValueError: ('The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()', 'occurred at index c')
```

### Source code / logs

```python
import modin.pandas as pd
df = pd.DataFrame({"c":[[1,2,3,4], [4,5,6,7], [1,2,3,4,5]], "b":list("abc")})
df["c"].apply(lambda x: x[0])
```
<!-- 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/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -691,7 +691,9 @@ def arg(s):
 
         return self.__constructor__(
             query_compiler=self._query_compiler.applymap(
-                lambda s: arg(s) if not pandas.isnull(s) or na_action is None else s
+                lambda s: arg(s)
+                if pandas.isnull(s) is not True or na_action is None
+                else s
             )
         )
 


Test patch:
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -1720,6 +1720,16 @@ def test_map(data, na_values):
         pandas_series.map(mapper, na_action=na_values),
     )
 
+    # Return list objects
+    modin_series_lists = modin_series.map(lambda s: [s, s, s])
+    pandas_series_lists = pandas_series.map(lambda s: [s, s, s])
+    df_equals(modin_series_lists, pandas_series_lists)
+
+    # Index into list objects
+    df_equals(
+        modin_series_lists.map(lambda l: l[0]), pandas_series_lists.map(lambda l: l[0])
+    )
+
 
 def test_mask():
     modin_series = pd.Series(np.arange(10))