Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port dbp to SQLAlchemy 1.4/2.0 #135

Open
jtniehof opened this issue Nov 20, 2023 · 0 comments · May be fixed by #137
Open

Port dbp to SQLAlchemy 1.4/2.0 #135

jtniehof opened this issue Nov 20, 2023 · 0 comments · May be fixed by #137
Labels
technical-debt Not strictly a bug but suboptimal implementation

Comments

@jtniehof
Copy link
Member

dbprocessing currently uses "old" pre-2.0 SQLAlchemy syntax. The new 2.0 syntax is available in 1.4 and the old syntax is removed in 2.0. We need to just move to 1.4/2.0 syntax and leave behind old compatibility.

Minimal example to reproduce issue:

Install sqlalchemy 2.0 and

python3 setup.py build
cd unit_tests
python3 test_all.py

Error message/Traceback:

[a bunch of stuff]
======================================================================
ERROR: test_unique (test_Utils.UtilsTests)
unique
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jtniehof/scm/dbprocessing/unit_tests/test_Utils.py", line 30, in setUp
    self.makeTestDB()
  File "/home/jtniehof/scm/dbprocessing/unit_tests/dbp_testing.py", line 221, in makeTestDB
    dbprocessing.DButils.create_tables(
  File "/home/jtniehof/scm/dbprocessing/build/lib/dbprocessing/DButils.py", line 3899, in create_tables
    metadata.create_all(checkfirst=True)
TypeError: MetaData.create_all() missing 1 required positional argument: 'bind'

----------------------------------------------------------------------
Ran 301 tests in 3.384s

FAILED (errors=246)

(although there are other problems that are not solved by just doing this)

OS, Python version, and dependency version information:

Linux-5.15.0-76-generic-x86_64-with-glibc2.35
sys.version_info(major=3, minor=10, micro=12, releaselevel='final', serial=0)
sqlalchemy=2.0.23

Version of dbprocessing

Current git main a0bf5e6

Closure condition

This issue should be closed when all unit and functional tests run against SQLAlchemy 2.0 and the CI is updated.

@jtniehof jtniehof added the technical-debt Not strictly a bug but suboptimal implementation label Nov 20, 2023
@jtniehof jtniehof linked a pull request Feb 6, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical-debt Not strictly a bug but suboptimal implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant