prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [DataFrame] Error checking on Pandas version
  We need better reporting for issues with the Pandas version on a user's system. 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `python/ray/dataframe/__init__.py`
  Content:
  ```
  1 from __future__ import absolute_import
  2 from __future__ import division
  3 from __future__ import print_function
  4 import threading
  5 
  6 DEFAULT_NPARTITIONS = 4
  7 
  8 
  9 def set_npartition_default(n):
  10     global DEFAULT_NPARTITIONS
  11     DEFAULT_NPARTITIONS = n
  12 
  13 
  14 def get_npartitions():
  15     return DEFAULT_NPARTITIONS
  16 
  17 
  18 # We import these file after above two function
  19 # because they depend on npartitions.
  20 from .dataframe import DataFrame  # noqa: 402
  21 from .dataframe import from_pandas  # noqa: 402
  22 from .dataframe import to_pandas  # noqa: 402
  23 from .series import Series  # noqa: 402
  24 from .io import (read_csv, read_parquet)  # noqa: 402
  25 
  26 __all__ = [
  27     "DataFrame", "from_pandas", "to_pandas", "Series", "read_csv",
  28     "read_parquet"
  29 ]
  30 
  31 try:
  32     if threading.current_thread().name == "MainThread":
  33         import ray
  34         ray.init()
  35 except AssertionError:
  36     pass
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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
  @@ -1,8 +1,18 @@
   from __future__ import absolute_import
   from __future__ import division
   from __future__ import print_function
  +
  +import pandas as pd
   import threading
   
  +pd_version = pd.__version__
  +pd_major = int(pd_version.split(".")[0])
  +pd_minor = int(pd_version.split(".")[1])
  +
  +if pd_major == 0 and pd_minor < 22:
  +    raise Exception("In order to use Pandas on Ray, please upgrade your Pandas"
  +                    " version to >= 0.22.")
  +
   DEFAULT_NPARTITIONS = 4
  
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@@ -1,8 +1,18 @@\n from __future__ import absolute_import\n from __future__ import division\n from __future__ import print_function\n+\n+import pandas as pd\n import threading\n \n+pd_version = pd.__version__\n+pd_major = int(pd_version.split(\".\")[0])\n+pd_minor = int(pd_version.split(\".\")[1])\n+\n+if pd_major == 0 and pd_minor < 22:\n+    raise Exception(\"In order to use Pandas on Ray, please upgrade your Pandas\"\n+                    \" version to >= 0.22.\")\n+\n DEFAULT_NPARTITIONS = 4\n", "issue": "[DataFrame] Error checking on Pandas version\nWe need better reporting for issues with the Pandas version on a user's system. \n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport threading\n\nDEFAULT_NPARTITIONS = 4\n\n\ndef set_npartition_default(n):\n    global DEFAULT_NPARTITIONS\n    DEFAULT_NPARTITIONS = n\n\n\ndef get_npartitions():\n    return DEFAULT_NPARTITIONS\n\n\n# We import these file after above two function\n# because they depend on npartitions.\nfrom .dataframe import DataFrame  # noqa: 402\nfrom .dataframe import from_pandas  # noqa: 402\nfrom .dataframe import to_pandas  # noqa: 402\nfrom .series import Series  # noqa: 402\nfrom .io import (read_csv, read_parquet)  # noqa: 402\n\n__all__ = [\n    \"DataFrame\", \"from_pandas\", \"to_pandas\", \"Series\", \"read_csv\",\n    \"read_parquet\"\n]\n\ntry:\n    if threading.current_thread().name == \"MainThread\":\n        import ray\n        ray.init()\nexcept AssertionError:\n    pass\n", "path": "python/ray/dataframe/__init__.py"}], "after_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pandas as pd\nimport threading\n\npd_version = pd.__version__\npd_major = int(pd_version.split(\".\")[0])\npd_minor = int(pd_version.split(\".\")[1])\n\nif pd_major == 0 and pd_minor < 22:\n    raise Exception(\"In order to use Pandas on Ray, please upgrade your Pandas\"\n                    \" version to >= 0.22.\")\n\nDEFAULT_NPARTITIONS = 4\n\n\ndef set_npartition_default(n):\n    global DEFAULT_NPARTITIONS\n    DEFAULT_NPARTITIONS = n\n\n\ndef get_npartitions():\n    return DEFAULT_NPARTITIONS\n\n\n# We import these file after above two function\n# because they depend on npartitions.\nfrom .dataframe import DataFrame  # noqa: 402\nfrom .dataframe import from_pandas  # noqa: 402\nfrom .dataframe import to_pandas  # noqa: 402\nfrom .series import Series  # noqa: 402\nfrom .io import (read_csv, read_parquet)  # noqa: 402\n\n__all__ = [\n    \"DataFrame\", \"from_pandas\", \"to_pandas\", \"Series\", \"read_csv\",\n    \"read_parquet\"\n]\n\ntry:\n    if threading.current_thread().name == \"MainThread\":\n        import ray\n        ray.init()\nexcept AssertionError:\n    pass\n", "path": "python/ray/dataframe/__init__.py"}]}