Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2021 09:09 AM
from databricks import sql
hostname = '<name>.databricks.com'
http_path = '/sql/1.0/endpoints/<endpoint_id>'
access_token = '<personal_token>'
connection = sql.connect(server_hostname=hostname, http_path=http_path, access_token=access_token)
cursor = connection.cursor()
cursor.execute('test_query')
result = cursor.fetchall()
for row in result:
print(row)
cursor.close()
I get the following error when I execute the code above in notebook.
I have permissions for the entrypoint that I use and access_token. I have removed them in the question!
Error during OpenSession; Request: TOpenSessionReq(client_protocol=5, username=None, password=None, configuration=None) Error: None Bounded-Retry-Delay: None Attempt: 1/30 Elapsed-Seconds: 1.3954582214355469/900.0
----> 7 connection = sql.connect(server_hostname=hostname,
8 http_path=http_path,
9 access_token=access_token)
/databricks/python/lib/python3.8/site-packages/databricks/sql/__init__.py in connect(server_hostname, http_path, access_token, **kwargs)
26 """
27 from databricks.sql.client import Connection
---> 28 return Connection(server_hostname, http_path, access_token, **kwargs)
/databricks/python/lib/python3.8/site-packages/databricks/sql/client.py in __init__(self, server_hostname, http_path, access_token, **kwargs)
261 client_protocol=protocol_version
262 )
--> 263 response = self._make_request(self._client.OpenSession, open_session_req)
264 _check_status(response)
265 assert response.sessionHandle is not None, "Expected a session from OpenSession"
/databricks/python/lib/python3.8/site-packages/databricks/sql/client.py in _make_request(self, method, request)
372 or elapsed + retry_delay > self._retry_stop_after_attempts_duration):
373 _logger.error("Error during " + log_base)
--> 374 raise OperationalError("Error during Thrift request" +
375 (": " + error_message) if error_message else "",
376 error)
OperationalError: ('', EOFError())
Labels:
16 REPLIES 16
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 05:39 AM
Hi @Borislav Blagoev , were you able to check/adjust your IP access controls for your workspace, or ask your admin/support to do so?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2022 06:52 AM
Thanks a lot for the help the admins will help me to manage the IPs. Sorry for the slow response.


- « Previous
-
- 1
- 2
- Next »