pyodbc – How to connect to azure synapse using apache superset

I am trying to setup a new apache superset server to query on an existing Azure Synapse serverless SQL pool. As per the documentation, I should be good to go if I installed pymssql and pyodbc packages as dependencies along with the superset package in a virtual environment. But, when I try to connect it to my DB, the server throws a 1002 error.

Am I missing something in my setup? I tried installing superset using docker as well as from scratch and the issue seems to be appearing in both the cases.

Below are the error logs from the server:

2022-07-21 20:49:57,540:INFO:werkzeug:127.0.0.1 - - [21/Jul/2022 20:49:57] "GET /api/v1/me/ HTTP/1.1" 200 -
SupersetErrorsException
Traceback (most recent call last):
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/commands/test_connection.py", line 120, in run
    raise DBAPIError(None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
(Background on this error at: http://sqlalche.me/e/13/dbapi)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps
    return f(self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 113, in wraps
    raise ex
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 110, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/utils/core.py", line 1507, in time_function
    response = func(*args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/utils/log.py", line 245, in wrapper
    value = f(*args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 83, in wraps
    return f(self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/api.py", line 709, in test_connection
    TestConnectionDatabaseCommand(g.user, item).run()
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/commands/test_connection.py", line 145, in run
    raise DatabaseTestConnectionFailedError(errors) from ex
superset.databases.commands.exceptions.DatabaseTestConnectionFailedError: [SupersetError(message="(builtins.NoneType) Nonen(Background on this error at: http://sqlalche.me/e/13/dbapi)", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Azure Synapse', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
2022-07-21 20:49:58,608:WARNING:superset.views.base:SupersetErrorsException
Traceback (most recent call last):
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/commands/test_connection.py", line 120, in run
    raise DBAPIError(None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
(Background on this error at: http://sqlalche.me/e/13/dbapi)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps
    return f(self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 113, in wraps
    raise ex
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 110, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/utils/core.py", line 1507, in time_function
    response = func(*args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/utils/log.py", line 245, in wrapper
    value = f(*args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/views/base_api.py", line 83, in wraps
    return f(self, *args, **kwargs)
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/api.py", line 709, in test_connection
    TestConnectionDatabaseCommand(g.user, item).run()
  File "/Users/onechampionship/venv/lib/python3.9/site-packages/superset/databases/commands/test_connection.py", line 145, in run
    raise DatabaseTestConnectionFailedError(errors) from ex
superset.databases.commands.exceptions.DatabaseTestConnectionFailedError: [SupersetError(message="(builtins.NoneType) Nonen(Background on this error at: http://sqlalche.me/e/13/dbapi)", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Azure Synapse', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Leave a Comment