We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Improve docstrings for hdfs_connect and impala_connect
@laserson can you take a crack at these?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ibis/impala/api.py`
Content:
```
1 # Copyright 2015 Cloudera Inc
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13 
14 from ibis.impala.client import (ImpalaConnection, ImpalaClient,  # noqa
15                                 Database, ImpalaTable)
16 from ibis.impala.udf import *  # noqa
17 from ibis.impala.madlib import MADLibAPI  # noqa
18 from ibis.config import options
19 
20 
21 def connect(host='localhost', port=21050, database='default', timeout=45,
22             use_ssl=False, ca_cert=None, user=None, password=None,
23             auth_mechanism='NOSASL', kerberos_service_name='impala',
24             pool_size=8, hdfs_client=None):
25     """
26     Create an Impala Client for use with Ibis
27 
28     Parameters
29     ----------
30     host : host name
31     port : int, default 21050 (HiveServer 2)
32     database :
33     timeout :
34     use_ssl : boolean
35     ca_cert :
36     user :
37     password :
38     auth_mechanism : {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}
39     kerberos_service_name : string, default 'impala'
40 
41     Examples
42     --------
43     >>> hdfs = ibis.hdfs_connect(**hdfs_params)
44     >>> client = ibis.impala.connect(hdfs_client=hdfs, **impala_params)
45 
46     Returns
47     -------
48     con : ImpalaClient
49     """
50     params = {
51         'host': host,
52         'port': port,
53         'database': database,
54         'timeout': timeout,
55         'use_ssl': use_ssl,
56         'ca_cert': ca_cert,
57         'user': user,
58         'password': password,
59         'auth_mechanism': auth_mechanism,
60         'kerberos_service_name': kerberos_service_name
61     }
62 
63     con = ImpalaConnection(pool_size=pool_size, **params)
64     client = ImpalaClient(con, hdfs_client=hdfs_client)
65 
66     if options.default_backend is None:
67         options.default_backend = client
68 
69     return client
70
```

Path: `ibis/__init__.py`
Content:
```
1 # Copyright 2014 Cloudera Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 
16 # flake8: noqa
17 
18 __version__ = '0.5.0'
19 
20 from ibis.filesystems import HDFS, WebHDFS
21 from ibis.common import IbisError
22 
23 import ibis.expr.api as api
24 import ibis.expr.types as ir
25 
26 # __all__ is defined
27 from ibis.expr.api import *
28 
29 import ibis.impala.api as impala
30 import ibis.sql.sqlite.api as sqlite
31 
32 import ibis.config_init
33 from ibis.config import options
34 import ibis.util as util
35 
36 
37 # Deprecated
38 impala_connect = util.deprecate(impala.connect,
39                                 'impala_connect is deprecated, use'
40                                 ' ibis.impala.connect instead')
41 
42 
43 def make_client(db, hdfs_client=None):
44     """
45     Create an Ibis client from a database connection and optional additional
46     connections (like HDFS)
47 
48     Parameters
49     ----------
50     db : Connection
51       e.g. produced by ibis.impala.connect
52     hdfs_client : ibis HDFS client
53 
54     Examples
55     --------
56     >>> con = ibis.impala.connect(**impala_params)
57     >>> hdfs = ibis.hdfs_connect(**hdfs_params)
58     >>> client = ibis.make_client(con, hdfs_client=hdfs)
59 
60     Returns
61     -------
62     client : IbisClient
63     """
64     db._hdfs = hdfs_client
65     return db
66 
67 make_client = util.deprecate(
68     make_client, ('make_client is deprecated. '
69                   'Use ibis.impala.connect '
70                   ' with hdfs_client=hdfs_client'))
71 
72 
73 def hdfs_connect(host='localhost', port=50070, protocol='webhdfs',
74                  auth_mechanism='NOSASL', verify=True, **kwds):
75     """
76     Connect to HDFS
77 
78     Parameters
79     ----------
80     host : string
81     port : int, default 50070 (webhdfs default)
82     protocol : {'webhdfs'}
83     auth_mechanism : {'NOSASL' <- default, 'GSSAPI', 'LDAP', 'PLAIN'}
84     verify : boolean, default False
85         Set to False to turn off verifying SSL certificates
86 
87     Other keywords are forwarded to hdfs library classes
88 
89     Returns
90     -------
91     client : ibis HDFS client
92     """
93     import requests
94     session = kwds.setdefault('session', requests.Session())
95     session.verify = verify
96     if auth_mechanism in ['GSSAPI', 'LDAP']:
97         try:
98             import requests_kerberos
99         except ImportError:
100             raise IbisError(
101                 "Unable to import requests-kerberos, which is required for "
102                 "Kerberos HDFS support. Install it by executing `pip install "
103                 "requests-kerberos` or `pip install hdfs[kerberos]`.")
104         from hdfs.ext.kerberos import KerberosClient
105         url = 'https://{0}:{1}'.format(host, port) # note SSL
106         kwds.setdefault('mutual_auth', 'OPTIONAL')
107         hdfs_client = KerberosClient(url, **kwds)
108     else:
109         from hdfs.client import InsecureClient
110         url = 'http://{0}:{1}'.format(host, port)
111         hdfs_client = InsecureClient(url, **kwds)
112     return WebHDFS(hdfs_client)
113 
114 def test(impala=False):
115     import pytest
116     import ibis
117     import os
118 
119     ibis_dir, _ = os.path.split(ibis.__file__)
120 
121     args = ['--pyargs', ibis_dir]
122     if impala:
123         args.append('--impala')
124     pytest.main(args)
125
```
--- 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()

```

diff --git a/ibis/__init__.py b/ibis/__init__.py
--- a/ibis/__init__.py
+++ b/ibis/__init__.py
@@ -77,18 +77,19 @@
 
     Parameters
     ----------
-    host : string
-    port : int, default 50070 (webhdfs default)
+    host : string, Host name of the HDFS NameNode
+    port : int, NameNode's WebHDFS port (default 50070)
     protocol : {'webhdfs'}
-    auth_mechanism : {'NOSASL' <- default, 'GSSAPI', 'LDAP', 'PLAIN'}
-    verify : boolean, default False
-        Set to False to turn off verifying SSL certificates
+    auth_mechanism : string, Set to NOSASL or PLAIN for non-secure clusters.
+        Set to GSSAPI or LDAP for Kerberos-secured clusters.
+    verify : boolean, Set to False to turn off verifying SSL certificates.
+        (default True)
 
     Other keywords are forwarded to hdfs library classes
 
     Returns
     -------
-    client : ibis HDFS client
+    client : WebHDFS
     """
     import requests
     session = kwds.setdefault('session', requests.Session())
diff --git a/ibis/impala/api.py b/ibis/impala/api.py
--- a/ibis/impala/api.py
+++ b/ibis/impala/api.py
@@ -23,20 +23,27 @@
             auth_mechanism='NOSASL', kerberos_service_name='impala',
             pool_size=8, hdfs_client=None):
     """
-    Create an Impala Client for use with Ibis
+    Create an ImpalaClient for use with Ibis.
 
     Parameters
     ----------
-    host : host name
-    port : int, default 21050 (HiveServer 2)
-    database :
-    timeout :
-    use_ssl : boolean
-    ca_cert :
-    user :
-    password :
-    auth_mechanism : {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}
-    kerberos_service_name : string, default 'impala'
+    host : string, Host name of the impalad or HiveServer2 in Hive
+    port : int, Defaults to 21050 (Impala's HiveServer2)
+    database : string, Default database when obtaining new cursors
+    timeout : int, Connection timeout (seconds) when communicating with
+        HiveServer2
+    use_ssl : boolean, Use SSL when connecting to HiveServer2
+    ca_cert : string, Local path to 3rd party CA certificate or copy of server
+        certificate for self-signed certificates. If SSL is enabled, but this
+        argument is None, then certificate validation is skipped.
+    user : string, LDAP user to authenticate
+    password : string, LDAP password to authenticate
+    auth_mechanism : string, {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}.
+        Use NOSASL for non-secured Impala connections.  Use PLAIN for
+        non-secured Hive clusters.  Use LDAP for LDAP authenticated
+        connections.  Use GSSAPI for Kerberos-secured clusters.
+    kerberos_service_name : string, Specify particular impalad service
+        principal.
 
     Examples
     --------

{"golden_diff": "diff --git a/ibis/__init__.py b/ibis/__init__.py\n--- a/ibis/__init__.py\n+++ b/ibis/__init__.py\n@@ -77,18 +77,19 @@\n \n     Parameters\n     ----------\n-    host : string\n-    port : int, default 50070 (webhdfs default)\n+    host : string, Host name of the HDFS NameNode\n+    port : int, NameNode's WebHDFS port (default 50070)\n     protocol : {'webhdfs'}\n-    auth_mechanism : {'NOSASL' <- default, 'GSSAPI', 'LDAP', 'PLAIN'}\n-    verify : boolean, default False\n-        Set to False to turn off verifying SSL certificates\n+    auth_mechanism : string, Set to NOSASL or PLAIN for non-secure clusters.\n+        Set to GSSAPI or LDAP for Kerberos-secured clusters.\n+    verify : boolean, Set to False to turn off verifying SSL certificates.\n+        (default True)\n \n     Other keywords are forwarded to hdfs library classes\n \n     Returns\n     -------\n-    client : ibis HDFS client\n+    client : WebHDFS\n     \"\"\"\n     import requests\n     session = kwds.setdefault('session', requests.Session())\ndiff --git a/ibis/impala/api.py b/ibis/impala/api.py\n--- a/ibis/impala/api.py\n+++ b/ibis/impala/api.py\n@@ -23,20 +23,27 @@\n             auth_mechanism='NOSASL', kerberos_service_name='impala',\n             pool_size=8, hdfs_client=None):\n     \"\"\"\n-    Create an Impala Client for use with Ibis\n+    Create an ImpalaClient for use with Ibis.\n \n     Parameters\n     ----------\n-    host : host name\n-    port : int, default 21050 (HiveServer 2)\n-    database :\n-    timeout :\n-    use_ssl : boolean\n-    ca_cert :\n-    user :\n-    password :\n-    auth_mechanism : {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}\n-    kerberos_service_name : string, default 'impala'\n+    host : string, Host name of the impalad or HiveServer2 in Hive\n+    port : int, Defaults to 21050 (Impala's HiveServer2)\n+    database : string, Default database when obtaining new cursors\n+    timeout : int, Connection timeout (seconds) when communicating with\n+        HiveServer2\n+    use_ssl : boolean, Use SSL when connecting to HiveServer2\n+    ca_cert : string, Local path to 3rd party CA certificate or copy of server\n+        certificate for self-signed certificates. If SSL is enabled, but this\n+        argument is None, then certificate validation is skipped.\n+    user : string, LDAP user to authenticate\n+    password : string, LDAP password to authenticate\n+    auth_mechanism : string, {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}.\n+        Use NOSASL for non-secured Impala connections.  Use PLAIN for\n+        non-secured Hive clusters.  Use LDAP for LDAP authenticated\n+        connections.  Use GSSAPI for Kerberos-secured clusters.\n+    kerberos_service_name : string, Specify particular impalad service\n+        principal.\n \n     Examples\n     --------\n", "issue": "Improve docstrings for hdfs_connect and impala_connect\n@laserson can you take a crack at these?\n\n", "before_files": [{"content": "# Copyright 2015 Cloudera Inc\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom ibis.impala.client import (ImpalaConnection, ImpalaClient,  # noqa\n                                Database, ImpalaTable)\nfrom ibis.impala.udf import *  # noqa\nfrom ibis.impala.madlib import MADLibAPI  # noqa\nfrom ibis.config import options\n\n\ndef connect(host='localhost', port=21050, database='default', timeout=45,\n            use_ssl=False, ca_cert=None, user=None, password=None,\n            auth_mechanism='NOSASL', kerberos_service_name='impala',\n            pool_size=8, hdfs_client=None):\n    \"\"\"\n    Create an Impala Client for use with Ibis\n\n    Parameters\n    ----------\n    host : host name\n    port : int, default 21050 (HiveServer 2)\n    database :\n    timeout :\n    use_ssl : boolean\n    ca_cert :\n    user :\n    password :\n    auth_mechanism : {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}\n    kerberos_service_name : string, default 'impala'\n\n    Examples\n    --------\n    >>> hdfs = ibis.hdfs_connect(**hdfs_params)\n    >>> client = ibis.impala.connect(hdfs_client=hdfs, **impala_params)\n\n    Returns\n    -------\n    con : ImpalaClient\n    \"\"\"\n    params = {\n        'host': host,\n        'port': port,\n        'database': database,\n        'timeout': timeout,\n        'use_ssl': use_ssl,\n        'ca_cert': ca_cert,\n        'user': user,\n        'password': password,\n        'auth_mechanism': auth_mechanism,\n        'kerberos_service_name': kerberos_service_name\n    }\n\n    con = ImpalaConnection(pool_size=pool_size, **params)\n    client = ImpalaClient(con, hdfs_client=hdfs_client)\n\n    if options.default_backend is None:\n        options.default_backend = client\n\n    return client\n", "path": "ibis/impala/api.py"}, {"content": "# Copyright 2014 Cloudera Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# flake8: noqa\n\n__version__ = '0.5.0'\n\nfrom ibis.filesystems import HDFS, WebHDFS\nfrom ibis.common import IbisError\n\nimport ibis.expr.api as api\nimport ibis.expr.types as ir\n\n# __all__ is defined\nfrom ibis.expr.api import *\n\nimport ibis.impala.api as impala\nimport ibis.sql.sqlite.api as sqlite\n\nimport ibis.config_init\nfrom ibis.config import options\nimport ibis.util as util\n\n\n# Deprecated\nimpala_connect = util.deprecate(impala.connect,\n                                'impala_connect is deprecated, use'\n                                ' ibis.impala.connect instead')\n\n\ndef make_client(db, hdfs_client=None):\n    \"\"\"\n    Create an Ibis client from a database connection and optional additional\n    connections (like HDFS)\n\n    Parameters\n    ----------\n    db : Connection\n      e.g. produced by ibis.impala.connect\n    hdfs_client : ibis HDFS client\n\n    Examples\n    --------\n    >>> con = ibis.impala.connect(**impala_params)\n    >>> hdfs = ibis.hdfs_connect(**hdfs_params)\n    >>> client = ibis.make_client(con, hdfs_client=hdfs)\n\n    Returns\n    -------\n    client : IbisClient\n    \"\"\"\n    db._hdfs = hdfs_client\n    return db\n\nmake_client = util.deprecate(\n    make_client, ('make_client is deprecated. '\n                  'Use ibis.impala.connect '\n                  ' with hdfs_client=hdfs_client'))\n\n\ndef hdfs_connect(host='localhost', port=50070, protocol='webhdfs',\n                 auth_mechanism='NOSASL', verify=True, **kwds):\n    \"\"\"\n    Connect to HDFS\n\n    Parameters\n    ----------\n    host : string\n    port : int, default 50070 (webhdfs default)\n    protocol : {'webhdfs'}\n    auth_mechanism : {'NOSASL' <- default, 'GSSAPI', 'LDAP', 'PLAIN'}\n    verify : boolean, default False\n        Set to False to turn off verifying SSL certificates\n\n    Other keywords are forwarded to hdfs library classes\n\n    Returns\n    -------\n    client : ibis HDFS client\n    \"\"\"\n    import requests\n    session = kwds.setdefault('session', requests.Session())\n    session.verify = verify\n    if auth_mechanism in ['GSSAPI', 'LDAP']:\n        try:\n            import requests_kerberos\n        except ImportError:\n            raise IbisError(\n                \"Unable to import requests-kerberos, which is required for \"\n                \"Kerberos HDFS support. Install it by executing `pip install \"\n                \"requests-kerberos` or `pip install hdfs[kerberos]`.\")\n        from hdfs.ext.kerberos import KerberosClient\n        url = 'https://{0}:{1}'.format(host, port) # note SSL\n        kwds.setdefault('mutual_auth', 'OPTIONAL')\n        hdfs_client = KerberosClient(url, **kwds)\n    else:\n        from hdfs.client import InsecureClient\n        url = 'http://{0}:{1}'.format(host, port)\n        hdfs_client = InsecureClient(url, **kwds)\n    return WebHDFS(hdfs_client)\n\ndef test(impala=False):\n    import pytest\n    import ibis\n    import os\n\n    ibis_dir, _ = os.path.split(ibis.__file__)\n\n    args = ['--pyargs', ibis_dir]\n    if impala:\n        args.append('--impala')\n    pytest.main(args)\n", "path": "ibis/__init__.py"}], "after_files": [{"content": "# Copyright 2015 Cloudera Inc\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom ibis.impala.client import (ImpalaConnection, ImpalaClient,  # noqa\n                                Database, ImpalaTable)\nfrom ibis.impala.udf import *  # noqa\nfrom ibis.impala.madlib import MADLibAPI  # noqa\nfrom ibis.config import options\n\n\ndef connect(host='localhost', port=21050, database='default', timeout=45,\n            use_ssl=False, ca_cert=None, user=None, password=None,\n            auth_mechanism='NOSASL', kerberos_service_name='impala',\n            pool_size=8, hdfs_client=None):\n    \"\"\"\n    Create an ImpalaClient for use with Ibis.\n\n    Parameters\n    ----------\n    host : string, Host name of the impalad or HiveServer2 in Hive\n    port : int, Defaults to 21050 (Impala's HiveServer2)\n    database : string, Default database when obtaining new cursors\n    timeout : int, Connection timeout (seconds) when communicating with\n        HiveServer2\n    use_ssl : boolean, Use SSL when connecting to HiveServer2\n    ca_cert : string, Local path to 3rd party CA certificate or copy of server\n        certificate for self-signed certificates. If SSL is enabled, but this\n        argument is None, then certificate validation is skipped.\n    user : string, LDAP user to authenticate\n    password : string, LDAP password to authenticate\n    auth_mechanism : string, {'NOSASL' <- default, 'PLAIN', 'GSSAPI', 'LDAP'}.\n        Use NOSASL for non-secured Impala connections.  Use PLAIN for\n        non-secured Hive clusters.  Use LDAP for LDAP authenticated\n        connections.  Use GSSAPI for Kerberos-secured clusters.\n    kerberos_service_name : string, Specify particular impalad service\n        principal.\n\n    Examples\n    --------\n    >>> hdfs = ibis.hdfs_connect(**hdfs_params)\n    >>> client = ibis.impala.connect(hdfs_client=hdfs, **impala_params)\n\n    Returns\n    -------\n    con : ImpalaClient\n    \"\"\"\n    params = {\n        'host': host,\n        'port': port,\n        'database': database,\n        'timeout': timeout,\n        'use_ssl': use_ssl,\n        'ca_cert': ca_cert,\n        'user': user,\n        'password': password,\n        'auth_mechanism': auth_mechanism,\n        'kerberos_service_name': kerberos_service_name\n    }\n\n    con = ImpalaConnection(pool_size=pool_size, **params)\n    client = ImpalaClient(con, hdfs_client=hdfs_client)\n\n    if options.default_backend is None:\n        options.default_backend = client\n\n    return client\n", "path": "ibis/impala/api.py"}, {"content": "# Copyright 2014 Cloudera Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n# flake8: noqa\n\n__version__ = '0.5.0'\n\nfrom ibis.filesystems import HDFS, WebHDFS\nfrom ibis.common import IbisError\n\nimport ibis.expr.api as api\nimport ibis.expr.types as ir\n\n# __all__ is defined\nfrom ibis.expr.api import *\n\nimport ibis.impala.api as impala\nimport ibis.sql.sqlite.api as sqlite\n\nimport ibis.config_init\nfrom ibis.config import options\nimport ibis.util as util\n\n\n# Deprecated\nimpala_connect = util.deprecate(impala.connect,\n                                'impala_connect is deprecated, use'\n                                ' ibis.impala.connect instead')\n\n\ndef make_client(db, hdfs_client=None):\n    \"\"\"\n    Create an Ibis client from a database connection and optional additional\n    connections (like HDFS)\n\n    Parameters\n    ----------\n    db : Connection\n      e.g. produced by ibis.impala.connect\n    hdfs_client : ibis HDFS client\n\n    Examples\n    --------\n    >>> con = ibis.impala.connect(**impala_params)\n    >>> hdfs = ibis.hdfs_connect(**hdfs_params)\n    >>> client = ibis.make_client(con, hdfs_client=hdfs)\n\n    Returns\n    -------\n    client : IbisClient\n    \"\"\"\n    db._hdfs = hdfs_client\n    return db\n\nmake_client = util.deprecate(\n    make_client, ('make_client is deprecated. '\n                  'Use ibis.impala.connect '\n                  ' with hdfs_client=hdfs_client'))\n\n\ndef hdfs_connect(host='localhost', port=50070, protocol='webhdfs',\n                 auth_mechanism='NOSASL', verify=True, **kwds):\n    \"\"\"\n    Connect to HDFS\n\n    Parameters\n    ----------\n    host : string, Host name of the HDFS NameNode\n    port : int, NameNode's WebHDFS port (default 50070)\n    protocol : {'webhdfs'}\n    auth_mechanism : string, Set to NOSASL or PLAIN for non-secure clusters.\n        Set to GSSAPI or LDAP for Kerberos-secured clusters.\n    verify : boolean, Set to False to turn off verifying SSL certificates.\n        (default True)\n\n    Other keywords are forwarded to hdfs library classes\n\n    Returns\n    -------\n    client : WebHDFS\n    \"\"\"\n    import requests\n    session = kwds.setdefault('session', requests.Session())\n    session.verify = verify\n    if auth_mechanism in ['GSSAPI', 'LDAP']:\n        try:\n            import requests_kerberos\n        except ImportError:\n            raise IbisError(\n                \"Unable to import requests-kerberos, which is required for \"\n                \"Kerberos HDFS support. Install it by executing `pip install \"\n                \"requests-kerberos` or `pip install hdfs[kerberos]`.\")\n        from hdfs.ext.kerberos import KerberosClient\n        url = 'https://{0}:{1}'.format(host, port) # note SSL\n        kwds.setdefault('mutual_auth', 'OPTIONAL')\n        hdfs_client = KerberosClient(url, **kwds)\n    else:\n        from hdfs.client import InsecureClient\n        url = 'http://{0}:{1}'.format(host, port)\n        hdfs_client = InsecureClient(url, **kwds)\n    return WebHDFS(hdfs_client)\n\ndef test(impala=False):\n    import pytest\n    import ibis\n    import os\n\n    ibis_dir, _ = os.path.split(ibis.__file__)\n\n    args = ['--pyargs', ibis_dir]\n    if impala:\n        args.append('--impala')\n    pytest.main(args)\n", "path": "ibis/__init__.py"}]}