Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add oceanbase database when SQLALCHEMY URL contains tenant information #32409

Open
3 tasks done
fairchilddb opened this issue Feb 27, 2025 · 1 comment
Open
3 tasks done
Labels
data:connect:oceanbase data:databases Related to database configurations and connections

Comments

@fairchilddb
Copy link

Bug description

please help!
superset version 4.1.1
OceanBase version 3.1.4

SQLALCHEMY URL should be

oceanbase://@#:@:/[?key=value&key=value...]

Stacktrace

Traceback (most recent call last):
File "/root/superset/lib64/python3.9/site-packages/superset/commands/database/test_connection.py", line 170, in run
raise DBAPIError(ex_str or None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
[SQL: '>=' not supported between instances of 'NoneType' and 'tuple']
(Background on this error at: https://sqlalche.me/e/14/dbapi)

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

Traceback (most recent call last):
File "/root/superset/lib64/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/root/superset/lib64/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/root/superset/lib64/python3.9/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
return f(self, *args, **kwargs)
File "/root/superset/lib64/python3.9/site-packages/superset/views/base_api.py", line 119, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/root/superset/lib64/python3.9/site-packages/superset/utils/core.py", line 1364, in time_function
response = func(*args, **kwargs)
File "/root/superset/lib64/python3.9/site-packages/superset/utils/log.py", line 303, in wrapper
value = f(*args, **kwargs)
File "/root/superset/lib64/python3.9/site-packages/superset/views/base_api.py", line 91, in wraps
return f(self, *args, **kwargs)
File "/root/superset/lib64/python3.9/site-packages/superset/databases/api.py", line 1215, in test_connection
TestConnectionDatabaseCommand(item).run()
File "/root/superset/lib64/python3.9/site-packages/superset/commands/database/test_connection.py", line 199, in run
raise SupersetErrorsException(errors) from ex
superset.exceptions.SupersetErrorsException: [SupersetError(message="(builtins.NoneType) None\n[SQL: '>=' not supported between instances of 'NoneType' and 'tuple']\n(Background on this error at: https://sqlalche.me/e/14/dbapi)", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'OceanBase', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Screenshots/recordings

No response

Superset version

4.1.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the data:databases Related to database configurations and connections label Feb 27, 2025
Copy link

dosubot bot commented Feb 27, 2025

I found a similar unsolved discussion regarding the inability to add an OceanBase database when the SQLALCHEMY URL contains tenant information. You can view the discussion here [1].

For the SQLALCHEMY URL, ensure it is correctly formatted as follows:

oceanbase://<User>:<Password>@<Host>:<Port>/<Database>

If tenant information is required, it should be included in the query parameters section of the URL, like this:

oceanbase://<User>:<Password>@<Host>:<Port>/<Database>?tenant=<TenantName>

The error you're encountering, related to a NoneType comparison, suggests there might be an issue with the database connection or the SQL expression being executed. Ensure that the SQLALCHEMY URL is correctly formatted and that the OceanBase database is properly set up to handle the requested operations [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect:oceanbase data:databases Related to database configurations and connections
Projects
None yet
Development

No branches or pull requests

2 participants