Skip to content

Remove the zxJDBC dialect and its entry points - #204

Open
aminghadersohi wants to merge 1 commit into
ibmdb:masterfrom
aminghadersohi:remove-zxjdbc-dialect
Open

aminghadersohi wants to merge 1 commit into
ibmdb:masterfrom
aminghadersohi:remove-zxjdbc-dialect

Conversation

@aminghadersohi

Copy link
Copy Markdown

Problem

ibm_db_sa/zxjdbc.py imports sqlalchemy.connectors.zxJDBC, which SQLAlchemy removed in 1.4. This package declares four sqlalchemy.dialects entry points that point at it:

  • db2.zxjdbc, db2.zxjdbc400
  • ibm_db_sa.zxjdbc, ibm_db_sa.zxjdbc400

On 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

  • Remove ibm_db_sa/zxjdbc.py and its four entry points.
  • Remove the two zxjdbc registrations from run_tests.py.
  • README: known limitation 7 now mentions PyODBC only.

The ibm_db, pyodbc and AS/400 dialects, and all their entry points, are unchanged.

Verification

Python 3.11, SQLAlchemy 2.0.52. The script loads every sqlalchemy.dialects entry point this distribution declares:

Build Loaded Failed
master 7f3866e (0.4.4) 8 4 (all four zxjdbc: No module named 'sqlalchemy.connectors.zxJDBC')
this branch 8 0

The same four failures reproduce with released 0.4.0 on SQLAlchemy 1.4.54. The built wheel's entry_points.txt lists exactly the eight remaining dialects, and the wheel contains no zxjdbc module.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant