Skip to content

Commit

Permalink
chore: Updates for SQLAlchemy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 4, 2023
1 parent 6ac762f commit 3d16c48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/unihan_db/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"""
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm import DeclarativeBase, relationship

Base = declarative_base()

class Base(DeclarativeBase):
pass


class Unhn(Base):
Expand Down
6 changes: 2 additions & 4 deletions tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ def test_import_object(session, engine):


def test_import_unihan(zip_file, session, engine, unihan_options):
Base.metadata.bind = engine
Base.metadata.create_all()
Base.metadata.create_all(bind=engine)
# bootstrap.bootstrap_unihan(Base.metadata, unihan_options)


def test_import_unihan_raw(zip_file, session, engine, unihan_options):
Base.metadata.bind = engine
Base.metadata.create_all()
Base.metadata.create_all(bind=engine)

bootstrap.bootstrap_unihan(session, unihan_options)

Expand Down

0 comments on commit 3d16c48

Please sign in to comment.