prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Capitalization of "S" in "S3://" results in inconsistent behaviors when reading from S3 path
  <!--
  General questions should be asked on the mailing list modin-dev@googlegroups.com.
  
  Before submitting an issue, please fill out the following form.
  -->
  
  ### System information
  - **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux
  - **Modin installed from (source or binary)**: binary
  - **Modin version**: 0.7.0
  - **Python version**: 3.6.8
  - **Exact command to reproduce**: 
  
  <!--
  You can obtain the Modin version with
  
  python -c "import modin; print(modin.__version__)"
  -->
  
  ### Describe the problem
  <!-- Describe the problem clearly here. -->
  Reading data from a S3 path, e.g. `read_csv`, `read_json`, behaves differently based on the capitalization of "S" in the path. See below code example.
  
  ### Source code / logs
  <!-- 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. -->
  ```
  import pandas as pd
  import ray
  import modin.pandas as mpd
  
  filepath = "s3://my-bucket/data/traffic.json"
  filepath_2 = "s3://my-bucket/data/BikeSharingDaily.csv"
  filepath_3 = "S3://my-bucket/data/BikeSharingDaily.csv"
  
  # working
  df_native = pd.read_json(filepath, lines=True)
  df_native_2 = pd.read_csv(filepath_2)
  
  # not working (FileNotFoundError: [Errno 2] No such file or directory: 's3://my-bucket/data/traffic.json')
  df_modin = mpd.read_json(filepath, lines=True)
  
  # working (but it prints, defaulting to pandas implementation)
  df_modin_2 = mpd.read_csv(filepath_2)
  
  # working (no additional print)
  df_modin_3 = mpd.read_csv(filepath_3)
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `modin/engines/base/io/file_reader.py`
  Content:
  ```
  1 import os
  2 import re
  3 
  4 S3_ADDRESS_REGEX = re.compile("s3://(.*?)/(.*)")
  5 NOT_IMPLEMENTED_MESSAGE = "Implement in children classes!"
  6 
  7 
  8 class FileReader:
  9     frame_cls = None
  10     frame_partition_cls = None
  11     query_compiler_cls = None
  12 
  13     @classmethod
  14     def get_path(cls, file_path):
  15         if S3_ADDRESS_REGEX.search(file_path):
  16             return file_path
  17         else:
  18             return os.path.abspath(file_path)
  19 
  20     @classmethod
  21     def file_open(cls, file_path, mode="rb", compression="infer"):
  22         if isinstance(file_path, str):
  23             match = S3_ADDRESS_REGEX.search(file_path)
  24             if match:
  25                 import s3fs as S3FS
  26                 from botocore.exceptions import NoCredentialsError
  27 
  28                 s3fs = S3FS.S3FileSystem(anon=False)
  29                 try:
  30                     return s3fs.open(file_path)
  31                 except NoCredentialsError:
  32                     s3fs = S3FS.S3FileSystem(anon=True)
  33                     return s3fs.open(file_path)
  34             elif compression == "gzip":
  35                 import gzip
  36 
  37                 return gzip.open(file_path, mode=mode)
  38             elif compression == "bz2":
  39                 import bz2
  40 
  41                 return bz2.BZ2File(file_path, mode=mode)
  42             elif compression == "xz":
  43                 import lzma
  44 
  45                 return lzma.LZMAFile(file_path, mode=mode)
  46             elif compression == "zip":
  47                 import zipfile
  48 
  49                 zf = zipfile.ZipFile(file_path, mode=mode.replace("b", ""))
  50                 if zf.mode == "w":
  51                     return zf
  52                 elif zf.mode == "r":
  53                     zip_names = zf.namelist()
  54                     if len(zip_names) == 1:
  55                         f = zf.open(zip_names.pop())
  56                         return f
  57                     elif len(zip_names) == 0:
  58                         raise ValueError(
  59                             "Zero files found in ZIP file {}".format(file_path)
  60                         )
  61                     else:
  62                         raise ValueError(
  63                             "Multiple files found in ZIP file."
  64                             " Only one file per ZIP: {}".format(zip_names)
  65                         )
  66 
  67         return open(file_path, mode=mode)
  68 
  69     @classmethod
  70     def file_size(cls, f):
  71         cur_pos = f.tell()
  72         f.seek(0, os.SEEK_END)
  73         size = f.tell()
  74         f.seek(cur_pos, os.SEEK_SET)
  75         return size
  76 
  77     @classmethod
  78     def file_exists(cls, file_path):
  79         if isinstance(file_path, str):
  80             match = S3_ADDRESS_REGEX.search(file_path)
  81             if match:
  82                 import s3fs as S3FS
  83                 from botocore.exceptions import NoCredentialsError
  84 
  85                 s3fs = S3FS.S3FileSystem(anon=False)
  86                 exists = False
  87                 try:
  88                     exists = s3fs.exists(file_path) or exists
  89                 except NoCredentialsError:
  90                     pass
  91                 s3fs = S3FS.S3FileSystem(anon=True)
  92                 return exists or s3fs.exists(file_path)
  93         return os.path.exists(file_path)
  94 
  95     @classmethod
  96     def deploy(cls, func, args, num_return_vals):
  97         raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)
  98 
  99     def parse(self, func, args, num_return_vals):
  100         raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)
  101 
  102     @classmethod
  103     def materialize(cls, obj_id):
  104         raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)
  105
  ```
  --- 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/modin/engines/base/io/file_reader.py b/modin/engines/base/io/file_reader.py
  --- a/modin/engines/base/io/file_reader.py
  +++ b/modin/engines/base/io/file_reader.py
  @@ -1,7 +1,7 @@
   import os
   import re
   
  -S3_ADDRESS_REGEX = re.compile("s3://(.*?)/(.*)")
  +S3_ADDRESS_REGEX = re.compile("[sS]3://(.*?)/(.*)")
   NOT_IMPLEMENTED_MESSAGE = "Implement in children classes!"
   
   
  @@ -21,7 +21,9 @@
       def file_open(cls, file_path, mode="rb", compression="infer"):
           if isinstance(file_path, str):
               match = S3_ADDRESS_REGEX.search(file_path)
  -            if match:
  +            if match is not None:
  +                if file_path[0] == "S":
  +                    file_path = "{}{}".format("s", file_path[1:])
                   import s3fs as S3FS
                   from botocore.exceptions import NoCredentialsError
   
  @@ -78,7 +80,9 @@
       def file_exists(cls, file_path):
           if isinstance(file_path, str):
               match = S3_ADDRESS_REGEX.search(file_path)
  -            if match:
  +            if match is not None:
  +                if file_path[0] == "S":
  +                    file_path = "{}{}".format("s", file_path[1:])
                   import s3fs as S3FS
                   from botocore.exceptions import NoCredentialsError
  
verification_info: {"golden_diff": "diff --git a/modin/engines/base/io/file_reader.py b/modin/engines/base/io/file_reader.py\n--- a/modin/engines/base/io/file_reader.py\n+++ b/modin/engines/base/io/file_reader.py\n@@ -1,7 +1,7 @@\n import os\n import re\n \n-S3_ADDRESS_REGEX = re.compile(\"s3://(.*?)/(.*)\")\n+S3_ADDRESS_REGEX = re.compile(\"[sS]3://(.*?)/(.*)\")\n NOT_IMPLEMENTED_MESSAGE = \"Implement in children classes!\"\n \n \n@@ -21,7 +21,9 @@\n     def file_open(cls, file_path, mode=\"rb\", compression=\"infer\"):\n         if isinstance(file_path, str):\n             match = S3_ADDRESS_REGEX.search(file_path)\n-            if match:\n+            if match is not None:\n+                if file_path[0] == \"S\":\n+                    file_path = \"{}{}\".format(\"s\", file_path[1:])\n                 import s3fs as S3FS\n                 from botocore.exceptions import NoCredentialsError\n \n@@ -78,7 +80,9 @@\n     def file_exists(cls, file_path):\n         if isinstance(file_path, str):\n             match = S3_ADDRESS_REGEX.search(file_path)\n-            if match:\n+            if match is not None:\n+                if file_path[0] == \"S\":\n+                    file_path = \"{}{}\".format(\"s\", file_path[1:])\n                 import s3fs as S3FS\n                 from botocore.exceptions import NoCredentialsError\n", "issue": "Capitalization of \"S\" in \"S3://\" results in inconsistent behaviors when reading from S3 path\n<!--\r\nGeneral questions should be asked on the mailing list modin-dev@googlegroups.com.\r\n\r\nBefore submitting an issue, please fill out the following form.\r\n-->\r\n\r\n### System information\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux\r\n- **Modin installed from (source or binary)**: binary\r\n- **Modin version**: 0.7.0\r\n- **Python version**: 3.6.8\r\n- **Exact command to reproduce**: \r\n\r\n<!--\r\nYou can obtain the Modin version with\r\n\r\npython -c \"import modin; print(modin.__version__)\"\r\n-->\r\n\r\n### Describe the problem\r\n<!-- Describe the problem clearly here. -->\r\nReading data from a S3 path, e.g. `read_csv`, `read_json`, behaves differently based on the capitalization of \"S\" in the path. See below code example.\r\n\r\n### Source code / logs\r\n<!-- 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. -->\r\n```\r\nimport pandas as pd\r\nimport ray\r\nimport modin.pandas as mpd\r\n\r\nfilepath = \"s3://my-bucket/data/traffic.json\"\r\nfilepath_2 = \"s3://my-bucket/data/BikeSharingDaily.csv\"\r\nfilepath_3 = \"S3://my-bucket/data/BikeSharingDaily.csv\"\r\n\r\n# working\r\ndf_native = pd.read_json(filepath, lines=True)\r\ndf_native_2 = pd.read_csv(filepath_2)\r\n\r\n# not working (FileNotFoundError: [Errno 2] No such file or directory: 's3://my-bucket/data/traffic.json')\r\ndf_modin = mpd.read_json(filepath, lines=True)\r\n\r\n# working (but it prints, defaulting to pandas implementation)\r\ndf_modin_2 = mpd.read_csv(filepath_2)\r\n\r\n# working (no additional print)\r\ndf_modin_3 = mpd.read_csv(filepath_3)\r\n```\n", "before_files": [{"content": "import os\nimport re\n\nS3_ADDRESS_REGEX = re.compile(\"s3://(.*?)/(.*)\")\nNOT_IMPLEMENTED_MESSAGE = \"Implement in children classes!\"\n\n\nclass FileReader:\n    frame_cls = None\n    frame_partition_cls = None\n    query_compiler_cls = None\n\n    @classmethod\n    def get_path(cls, file_path):\n        if S3_ADDRESS_REGEX.search(file_path):\n            return file_path\n        else:\n            return os.path.abspath(file_path)\n\n    @classmethod\n    def file_open(cls, file_path, mode=\"rb\", compression=\"infer\"):\n        if isinstance(file_path, str):\n            match = S3_ADDRESS_REGEX.search(file_path)\n            if match:\n                import s3fs as S3FS\n                from botocore.exceptions import NoCredentialsError\n\n                s3fs = S3FS.S3FileSystem(anon=False)\n                try:\n                    return s3fs.open(file_path)\n                except NoCredentialsError:\n                    s3fs = S3FS.S3FileSystem(anon=True)\n                    return s3fs.open(file_path)\n            elif compression == \"gzip\":\n                import gzip\n\n                return gzip.open(file_path, mode=mode)\n            elif compression == \"bz2\":\n                import bz2\n\n                return bz2.BZ2File(file_path, mode=mode)\n            elif compression == \"xz\":\n                import lzma\n\n                return lzma.LZMAFile(file_path, mode=mode)\n            elif compression == \"zip\":\n                import zipfile\n\n                zf = zipfile.ZipFile(file_path, mode=mode.replace(\"b\", \"\"))\n                if zf.mode == \"w\":\n                    return zf\n                elif zf.mode == \"r\":\n                    zip_names = zf.namelist()\n                    if len(zip_names) == 1:\n                        f = zf.open(zip_names.pop())\n                        return f\n                    elif len(zip_names) == 0:\n                        raise ValueError(\n                            \"Zero files found in ZIP file {}\".format(file_path)\n                        )\n                    else:\n                        raise ValueError(\n                            \"Multiple files found in ZIP file.\"\n                            \" Only one file per ZIP: {}\".format(zip_names)\n                        )\n\n        return open(file_path, mode=mode)\n\n    @classmethod\n    def file_size(cls, f):\n        cur_pos = f.tell()\n        f.seek(0, os.SEEK_END)\n        size = f.tell()\n        f.seek(cur_pos, os.SEEK_SET)\n        return size\n\n    @classmethod\n    def file_exists(cls, file_path):\n        if isinstance(file_path, str):\n            match = S3_ADDRESS_REGEX.search(file_path)\n            if match:\n                import s3fs as S3FS\n                from botocore.exceptions import NoCredentialsError\n\n                s3fs = S3FS.S3FileSystem(anon=False)\n                exists = False\n                try:\n                    exists = s3fs.exists(file_path) or exists\n                except NoCredentialsError:\n                    pass\n                s3fs = S3FS.S3FileSystem(anon=True)\n                return exists or s3fs.exists(file_path)\n        return os.path.exists(file_path)\n\n    @classmethod\n    def deploy(cls, func, args, num_return_vals):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n    def parse(self, func, args, num_return_vals):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n    @classmethod\n    def materialize(cls, obj_id):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n", "path": "modin/engines/base/io/file_reader.py"}], "after_files": [{"content": "import os\nimport re\n\nS3_ADDRESS_REGEX = re.compile(\"[sS]3://(.*?)/(.*)\")\nNOT_IMPLEMENTED_MESSAGE = \"Implement in children classes!\"\n\n\nclass FileReader:\n    frame_cls = None\n    frame_partition_cls = None\n    query_compiler_cls = None\n\n    @classmethod\n    def get_path(cls, file_path):\n        if S3_ADDRESS_REGEX.search(file_path):\n            return file_path\n        else:\n            return os.path.abspath(file_path)\n\n    @classmethod\n    def file_open(cls, file_path, mode=\"rb\", compression=\"infer\"):\n        if isinstance(file_path, str):\n            match = S3_ADDRESS_REGEX.search(file_path)\n            if match is not None:\n                if file_path[0] == \"S\":\n                    file_path = \"{}{}\".format(\"s\", file_path[1:])\n                import s3fs as S3FS\n                from botocore.exceptions import NoCredentialsError\n\n                s3fs = S3FS.S3FileSystem(anon=False)\n                try:\n                    return s3fs.open(file_path)\n                except NoCredentialsError:\n                    s3fs = S3FS.S3FileSystem(anon=True)\n                    return s3fs.open(file_path)\n            elif compression == \"gzip\":\n                import gzip\n\n                return gzip.open(file_path, mode=mode)\n            elif compression == \"bz2\":\n                import bz2\n\n                return bz2.BZ2File(file_path, mode=mode)\n            elif compression == \"xz\":\n                import lzma\n\n                return lzma.LZMAFile(file_path, mode=mode)\n            elif compression == \"zip\":\n                import zipfile\n\n                zf = zipfile.ZipFile(file_path, mode=mode.replace(\"b\", \"\"))\n                if zf.mode == \"w\":\n                    return zf\n                elif zf.mode == \"r\":\n                    zip_names = zf.namelist()\n                    if len(zip_names) == 1:\n                        f = zf.open(zip_names.pop())\n                        return f\n                    elif len(zip_names) == 0:\n                        raise ValueError(\n                            \"Zero files found in ZIP file {}\".format(file_path)\n                        )\n                    else:\n                        raise ValueError(\n                            \"Multiple files found in ZIP file.\"\n                            \" Only one file per ZIP: {}\".format(zip_names)\n                        )\n\n        return open(file_path, mode=mode)\n\n    @classmethod\n    def file_size(cls, f):\n        cur_pos = f.tell()\n        f.seek(0, os.SEEK_END)\n        size = f.tell()\n        f.seek(cur_pos, os.SEEK_SET)\n        return size\n\n    @classmethod\n    def file_exists(cls, file_path):\n        if isinstance(file_path, str):\n            match = S3_ADDRESS_REGEX.search(file_path)\n            if match is not None:\n                if file_path[0] == \"S\":\n                    file_path = \"{}{}\".format(\"s\", file_path[1:])\n                import s3fs as S3FS\n                from botocore.exceptions import NoCredentialsError\n\n                s3fs = S3FS.S3FileSystem(anon=False)\n                exists = False\n                try:\n                    exists = s3fs.exists(file_path) or exists\n                except NoCredentialsError:\n                    pass\n                s3fs = S3FS.S3FileSystem(anon=True)\n                return exists or s3fs.exists(file_path)\n        return os.path.exists(file_path)\n\n    @classmethod\n    def deploy(cls, func, args, num_return_vals):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n    def parse(self, func, args, num_return_vals):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n\n    @classmethod\n    def materialize(cls, obj_id):\n        raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)\n", "path": "modin/engines/base/io/file_reader.py"}]}