GitHub user dosubot[bot] added a comment to the discussion: Oracle DB drivers customization
<!-- Answer --> Since `superset_config.py` is imported as a Python module at startup, all top-level code executes automatically [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L1975-L2000). The simplest approach is to place the `init_oracle_client` call directly at the top of your `superset_config.py`: ```python import sys import oracledb oracledb.init_oracle_client(lib_dir="/path/to/instantclient_23_3") oracledb.version = "8.3.0" sys.modules["cx_Oracle"] = oracledb # ... rest of your config PREFERRED_DATABASES: list[str] = ["PostgreSQL", "MySQL", "Oracle"] ``` This will initialize the thick mode client before Superset sets up any database connections. Alternatively, if you want the initialization to happen after Superset's internal setup is complete, you can use the `FLASK_APP_MUTATOR` hook [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docs/docs/configuration/configuring-superset.mdx#L512-L530): ```python from flask import Flask def FLASK_APP_MUTATOR(app: Flask) -> None: import oracledb oracledb.init_oracle_client(lib_dir="/path/to/instantclient_23_3") ``` The top-level approach is preferred here since you want the driver ready before any connection attempts are made. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=b419e8f7-5ef9-4cd5-bb76-4badfe77130f) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/41212#discussioncomment-17361143 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
