Open vgvoleg opened 23 hours ago
Hello @vgvoleg! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this issue together!
To address the issue of creating a dataset without selecting a schema in Superset, you can consider the following approach:
Custom DB Engine Spec: You can create a custom db_engine_spec
for your database engine. In this custom spec, you can override methods to handle the absence of schemas. While Superset does not currently have a supports_schemas
attribute in its db_engine_spec
, you can implement logic in your custom spec to bypass schema requirements.
Adjust Engine Parameters: Use the adjust_engine_params
method in your custom db_engine_spec
to modify the SQLAlchemy URI and connection arguments. This can help ensure that queries run correctly without requiring a schema.
Modify Frontend Logic: If you have control over the frontend, you might consider modifying the logic in the DatabaseSelector
component to handle cases where schemas are not applicable. This could involve conditionally rendering the schema selection UI based on the database engine's capabilities.
SQLAlchemy's supports_schemas
: Although Superset does not directly use SQLAlchemy's supports_schemas
attribute, you can leverage this attribute in your custom spec to determine whether to enforce schema selection.
These steps should help you integrate a database engine that does not support schemas into Superset. If you need further customization, you might need to dive deeper into the Superset codebase to adjust how datasets are created and managed.
To continue talking to Dosu, mention @dosu.
More details were discussed in this thread: https://apache-superset.slack.com/archives/C014LS99C1K/p1732111768591139
Bug description
Hello everyone. I'm working on a new db_engine_spec and I've found it very difficult. Dialect I'm trying to integrate with Superset does not support schemas. AFAIK it is not a "rare" scenario - but it is impossible to create physical dataset using table without selecting some schema (only virtual datasets based on queries are available). What can I do to bypass this issue? If there is a good and easy hack - I'd like to use it!
It would be nice if db_engine_spec would have supports_schemas = True field that we could override in our custom spec. SQLAlchemy have this field already https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4/lib/sqlalchemy/engine/default.py#L72, so probably you can rely on it.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist