prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Worker dies when passed pandas DataFrame.
  ### System information
  - **Ray version**: 0.3.0
  - **Python version**: 3.6.0
  - **Exact command to reproduce**:
  
  ```python
  import pandas as pd
  import ray
  
  pd.__version__  # '0.19.2'
  
  ray.init()
  
  df = pd.DataFrame(data={'col1': [1, 2, 3, 4], 'col2': [3, 4, 5, 6]})
  
  @ray.remote
  def f(x):
      pass
  
  f.remote(df)
  ```
  
  The last line causes the following error to be printed in the background.
  
  ```
  A worker died or was killed while executing a task.
  ```
  
  cc @devin-petersohn
  
  </issue>
  <code>
  [start of python/ray/dataframe/__init__.py]
  1 from __future__ import absolute_import
  2 from __future__ import division
  3 from __future__ import print_function
  4 
  5 from .dataframe import DataFrame
  6 from .dataframe import from_pandas
  7 from .dataframe import to_pandas
  8 from .series import Series
  9 import ray
  10 import pandas as pd
  11 
  12 __all__ = ["DataFrame", "from_pandas", "to_pandas", "Series"]
  13 
  14 ray.register_custom_serializer(pd.DataFrame, use_pickle=True)
  15 ray.register_custom_serializer(pd.core.indexes.base.Index, use_pickle=True)
  16
  [end of python/ray/dataframe/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/python/ray/dataframe/__init__.py b/python/ray/dataframe/__init__.py
  --- a/python/ray/dataframe/__init__.py
  +++ b/python/ray/dataframe/__init__.py
  @@ -6,10 +6,5 @@
   from .dataframe import from_pandas
   from .dataframe import to_pandas
   from .series import Series
  -import ray
  -import pandas as pd
   
   __all__ = ["DataFrame", "from_pandas", "to_pandas", "Series"]
  -
  -ray.register_custom_serializer(pd.DataFrame, use_pickle=True)
  -ray.register_custom_serializer(pd.core.indexes.base.Index, use_pickle=True)
  
verification_info: {"golden_diff": "diff --git a/python/ray/dataframe/__init__.py b/python/ray/dataframe/__init__.py\n--- a/python/ray/dataframe/__init__.py\n+++ b/python/ray/dataframe/__init__.py\n@@ -6,10 +6,5 @@\n from .dataframe import from_pandas\n from .dataframe import to_pandas\n from .series import Series\n-import ray\n-import pandas as pd\n \n __all__ = [\"DataFrame\", \"from_pandas\", \"to_pandas\", \"Series\"]\n-\n-ray.register_custom_serializer(pd.DataFrame, use_pickle=True)\n-ray.register_custom_serializer(pd.core.indexes.base.Index, use_pickle=True)\n", "issue": "Worker dies when passed pandas DataFrame.\n### System information\r\n- **Ray version**: 0.3.0\r\n- **Python version**: 3.6.0\r\n- **Exact command to reproduce**:\r\n\r\n```python\r\nimport pandas as pd\r\nimport ray\r\n\r\npd.__version__  # '0.19.2'\r\n\r\nray.init()\r\n\r\ndf = pd.DataFrame(data={'col1': [1, 2, 3, 4], 'col2': [3, 4, 5, 6]})\r\n\r\n@ray.remote\r\ndef f(x):\r\n    pass\r\n\r\nf.remote(df)\r\n```\r\n\r\nThe last line causes the following error to be printed in the background.\r\n\r\n```\r\nA worker died or was killed while executing a task.\r\n```\r\n\r\ncc @devin-petersohn\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom .dataframe import DataFrame\nfrom .dataframe import from_pandas\nfrom .dataframe import to_pandas\nfrom .series import Series\nimport ray\nimport pandas as pd\n\n__all__ = [\"DataFrame\", \"from_pandas\", \"to_pandas\", \"Series\"]\n\nray.register_custom_serializer(pd.DataFrame, use_pickle=True)\nray.register_custom_serializer(pd.core.indexes.base.Index, use_pickle=True)\n", "path": "python/ray/dataframe/__init__.py"}]}