roskakori / pimdb

build a database from IMDb datasets
https://pypi.org/project/pimdb/
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Fix sqlalchemy error #42

Closed RealTehreal closed 6 months ago

RealTehreal commented 6 months ago

Hey there,

I decided to hop on again and try to get it to work. I wanted to start easy and just used pimdb transfer all, but get the following error:

INFO:pimdb:connecting to database sqlite:///pimdb.db (sqlite)
Traceback (most recent call last):
  File "/home/vm/venv-python-pimdb/bin/pimdb", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/vm/venv-python-pimdb/lib/python3.12/site-packages/pimdb/command.py", line 295, in main
    sys.exit(exit_code_for())
             ^^^^^^^^^^^^^^^
  File "/home/vm/venv-python-pimdb/lib/python3.12/site-packages/pimdb/command.py", line 281, in exit_code_for
    command_class(parser, args).run()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vm/venv-python-pimdb/lib/python3.12/site-packages/pimdb/command.py", line 185, in __init__
    self._database = Database(args.database, args.bulk_size, args.drop)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vm/venv-python-pimdb/lib/python3.12/site-packages/pimdb/database.py", line 473, in __init__
    self._metadata = MetaData(self._engine)
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vm/venv-python-pimdb/lib/python3.12/site-packages/sqlalchemy/sql/schema.py", line 5470, in __init__
    raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: expected schema argument to be a string, got <class 'sqlalchemy.engine.base.Engine'>.

The net wasn't very helpful. :-(

Any help is very appreciated.

Greets

roskakori commented 6 months ago

I'm currently in the process of bringing the package up to date concerning current versions of packages.

After this is done, I'll give it a test drive with PostgreSQL.

roskakori commented 6 months ago

@RealTehreal This is fixed with version 0.3.0, now available from PyPI.

The culprit was a broken dependency spec, which allowed to install SQLAlchemy 2.x although currently the code only supports SQLAlchemy 1.x.

RealTehreal commented 6 months ago

@RealTehreal This is fixed with version 0.3.0, now available from PyPI.

The culprit was a broken dependency spec, which allowed to install SQLAlchemy 2.x although currently the code only supports SQLAlchemy 1.x.

Oh, I see. I'll test it and report back afterward. Thank you!

RealTehreal commented 6 months ago

Now it works. Thanks for addressing the issue :-)

Greets