Repository navigation
Remove the zxJDBC dialect and its entry points - #204
Conversation
ibm_db_sa/zxjdbc.py imports sqlalchemy.connectors.zxJDBC, which SQLAlchemy removed in 1.4, and the dialect itself only runs on Jython, which cannot install this package (python_requires >= 3.9). The four sqlalchemy.dialects entry points that point at it therefore always fail to load with ModuleNotFoundError. Applications that enumerate installed dialects through entry points (for example to list available databases) hit and log that error on every scan. Drop the module, its four entry points and the matching test registrations. The ibm_db, pyodbc and AS/400 dialects are unchanged. Signed-off-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>
296790b to
1b83250
Compare
|
Hi @bimalkjha , This PR looks correct and ready to merge. As noted in the SQLAlchemy documentation, support for Jython/zxJDBC was removed upstream because it was no longer functional or supported. Since Reference from SQLAlchemy: Removed all dialect code related to support for Jython and zxJDBC. Jython has not been supported by SQLAlchemy for many years and it is not expected that the current zxJDBC code is at all functional; for the moment it just takes up space and adds confusion by showing up in documentation. At the moment, it appears that Jython has achieved Python 2.7 support in its releases but not Python 3. If Jython were to be supported again, the form it should take is against the Python 3 version of Jython, and the various zxJDBC stubs for various backends should be implemented as a third party dialect. References: #5094 Please merge this PR. Thank you! |
Problem
ibm_db_sa/zxjdbc.pyimportssqlalchemy.connectors.zxJDBC, which SQLAlchemy removed in 1.4. This package declares foursqlalchemy.dialectsentry points that point at it:db2.zxjdbc,db2.zxjdbc400ibm_db_sa.zxjdbc,ibm_db_sa.zxjdbc400On any supported SQLAlchemy 1.4 or 2.0 install, loading them always raises
ModuleNotFoundError: No module named 'sqlalchemy.connectors.zxJDBC'. The dialect also only ever worked on Jython, and Jython cannot install this package (python_requires >= 3.9), so it can't be used even with SQLAlchemy 1.3.Applications that enumerate installed dialects through entry points, for example to show which databases are available, hit and log this error on every scan.
Change
ibm_db_sa/zxjdbc.pyand its four entry points.run_tests.py.The
ibm_db,pyodbcand AS/400 dialects, and all their entry points, are unchanged.Verification
Python 3.11, SQLAlchemy 2.0.52. The script loads every
sqlalchemy.dialectsentry point this distribution declares:7f3866e(0.4.4)No module named 'sqlalchemy.connectors.zxJDBC')The same four failures reproduce with released 0.4.0 on SQLAlchemy 1.4.54. The built wheel's
entry_points.txtlists exactly the eight remaining dialects, and the wheel contains nozxjdbcmodule.