GitHub user dosubot[bot] added a comment to the discussion: Workaround: Oracle connection fails due to cx_Oracle lookup even when using oracledb
<!-- Greeting --> Hi @abedalawieh! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> Your workaround—installing oracledb and aliasing it as cx_Oracle in superset_config.py using sys.modules—is the recommended approach for resolving Oracle connection errors in Superset Docker deployments where only oracledb is installed. This is necessary because some dependencies (often SQLAlchemy dialects or third-party libraries) still look for cx_Oracle by name, even though oracledb is the modern, officially recommended replacement and cx_Oracle is no longer maintained since 2021. The workaround works by making Python treat oracledb as if it were cx_Oracle, bridging the compatibility gap and allowing connections to succeed as expected. This method is documented and used by others in the community as well [cite](https://github.com/apache/superset/issues/34816). There are no explicit references to cx_Oracle or oracledb in the Superset codebase itself, and no ongoing code changes or merged pull requests to natively support oracledb without this workaround. The aliasing must be applied externally in your configuration [cite](https://github.com/apache/superset/issues/34816). Recent documentation updates do recommend oracledb as the preferred driver [cite](https://github.com/apache/superset/pull/35242). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/af5038ed-d704-40fb-8587-21c03817fc2d?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Your%20workaround%E2%80%94installing%20oracledb%20and%20aliasing%20it%20as%20cx_Oracle%20in%20superset_config.py%20using%20sys.modules%E2%80%94is%20the%20recommended%20approach%20for%20resolving%20Oracle%20connection%20errors%20in%20Superset%20Docker%20deployments%20where%20only%20oracledb%20is%20installed.%20This%20is%20necessary%20because%20some%20dependencies%20%28often%20SQLAlchemy%20dialects%20or%20third-party%20libraries%29%20still%20look%20for%20cx_Oracle%20by%20name%2C%20even%20though%20oracledb%20is%20the%20modern%2C%20officially%20recommended%20replacement%20and%20cx_Oracle%20is%20no%20longer%20maintained%20since%202021.%20The%20workaround%20works%20by%20making%20Python%20treat%20oracledb%20as%20if%20it%20were%20cx_Oracle%2C%20bridging%20the %20compatibility%20gap%20and%20allowing%20connections%20to%20succeed%20as%20expected.%20This%20method%20is%20documented%20and%20used%20by%20others%20in%20the%20community%20as%20well%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/issues/34816%29.%0A%0AThere%20are%20no%20explicit%20references%20to%20cx_Oracle%20or%20oracledb%20in%20the%20Superset%20codebase%20itself%2C%20and%20no%20ongoing%20code%20changes%20or%20merged%20pull%20requests%20to%20natively%20support%20oracledb%20without%20this%20workaround.%20The%20aliasing%20must%20be%20applied%20externally%20in%20your%20configuration%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/issues/34816%29.%20Recent%20documentation%20updates%20do%20recommend%20oracledb%20as%20the%20preferred%20driver%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/pull/35242%29.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37428) GitHub link: https://github.com/apache/superset/discussions/37428#discussioncomment-15597030 ---- 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]
