dosubot[bot] commented on issue #37793:
URL: https://github.com/apache/superset/issues/37793#issuecomment-3868884049

   <!-- Answer -->
   Your plan is solid and matches the current best practice for Oracle 
connectivity in Superset Docker environments. Superset (and some dependencies) 
still look for the cx_Oracle module by name, even though Oracle recommends 
python-oracledb and cx_Oracle is deprecated. The recommended workaround is to 
install python-oracledb and alias it as cx_Oracle in your Superset config, like 
this:
   
   ```python
   import sys
   import oracledb
   oracledb.version = "8.3.0"  # optional, for compatibility
   sys.modules["cx_Oracle"] = oracledb
   ```
   
   Place this in your `superset_config.py` or `superset_config_docker.py` (for 
Docker, make sure it's in 
`/app/docker/pythonpath_dev/superset_config_docker.py` so Superset loads it). 
This will keep the Oracle menu visible and let you use the modern driver 
without patching Superset itself. Use the `oracle+oracledb://...` SQLAlchemy 
connection string as you described.
   
   A few users have hit environment-specific issues (like `DPY-1001: not 
connected to database`) with this approach, usually due to config file 
placement or Docker image differences. If you see that, double-check your 
config location or try a different Superset Docker image tag. There are no 
known side effects to this workaround, and it's documented and used by others 
in the community as well 
[discussion](https://github.com/apache/superset/discussions/37428) 
[issue](https://github.com/apache/superset/issues/34816).
   
   There are no merged pull requests or native code changes in Superset for 
direct oracledb support yet, so this aliasing approach is still necessary 
[discussion](https://github.com/apache/superset/discussions/37428). Recent docs 
do recommend oracledb as the preferred driver, but cx_Oracle is still required 
for detection.
   
   Let me know if you need a sample config or run into any specific errors!
   
   
   <!-- 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/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/df1b5351-12aa-4cac-b3d8-96a6d80111c4?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Your%20plan%20is%20solid%20and%20matches%20the%20current%20best%20practice%20for%20Oracle%20connectivity%20in%20Superset%20Docker%20environments.%20Superset%20%28and%20some%20dependencies%29%20still%20look%20for%20the%20cx_Oracle%20module%20by%20name%2C%20even%20though%20Oracle%20recommends%20python-oracledb%20and%20cx_Oracle%20is%20deprecated.%20The%20recommended%20workaround%20is%20to%20install%20python-oracledb%20and%20alias%20it%20as%20cx_Oracle%20in%20your%20Superset%20config%2C%20like%20this%3A%0A%0A%60%60%60python%0Aimport%20sys%0Aimport%20oracledb%0Aoracledb.version%20%3D%20%228.3.0%22%20%20%23%20optional%2C%20for%20compatibility%0Asys.modules%5B%22cx_Oracle%22%5D%20%3D%20oracledb%0A%60%60%60%0A%0APlace%20this%20in%20your%20%60superset_conf
 
ig.py%60%20or%20%60superset_config_docker.py%60%20%28for%20Docker%2C%20make%20sure%20it%27s%20in%20%60/app/docker/pythonpath_dev/superset_config_docker.py%60%20so%20Superset%20loads%20it%29.%20This%20will%20keep%20the%20Oracle%20menu%20visible%20and%20let%20you%20use%20the%20modern%20driver%20without%20patching%20Superset%20itself.%20Use%20the%20%60oracle%2Boracledb%3A//...%60%20SQLAlchemy%20connection%20string%20as%20you%20described.%0A%0AA%20few%20users%20have%20hit%20environment-specific%20issues%20%28like%20%60DPY-1001%3A%20not%20connected%20to%20database%60%29%20with%20this%20approach%2C%20usually%20due%20to%20config%20file%20placement%20or%20Docker%20image%20differences.%20If%20you%20see%20that%2C%20double-check%20your%20config%20location%20or%20try%20a%20different%20Superset%20Docker%20image%20tag.%20There%20are%20no%20known%20side%20effects%20to%20this%20workaround%2C%20and%20it%27s%20documented%20and%20used%20by%20others%20in%20the%20community%20as%20well%C2%A0%5Bdiscussion
 
%5D%28https%3A//github.com/apache/superset/discussions/37428%29%C2%A0%5Bissue%5D%28https%3A//github.com/apache/superset/issues/34816%29.%0A%0AThere%20are%20no%20merged%20pull%20requests%20or%20native%20code%20changes%20in%20Superset%20for%20direct%20oracledb%20support%20yet%2C%20so%20this%20aliasing%20approach%20is%20still%20necessary%C2%A0%5Bdiscussion%5D%28https%3A//github.com/apache/superset/discussions/37428%29.%20Recent%20docs%20do%20recommend%20oracledb%20as%20the%20preferred%20driver%2C%20but%20cx_Oracle%20is%20still%20required%20for%20detection.%0A%0ALet%20me%20know%20if%20you%20need%20a%20sample%20config%20or%20run%20into%20any%20specific%20errors%21)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/i
 ssues/37793)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to