Skip to content

Fix declarative_base sqlalchemy warning. #26

@simlmx

Description

@simlmx

Describe the bug
When running the tests, this warning appears:

================================================== warnings summary===================================================
../../.cache/pypoetry/virtualenvs/pv-site-production-gDBmdbVF-py3.10/lib/python3.10/site-packages/pvsite_datamodel/sqlmodels.py:19
  /home/simon/.cache/pypoetry/virtualenvs/pv-site-production-gDBmdbVF-py3.10/lib/python3.10/site-packages/pvsite_datamodel/sqlmodels.py:19: MovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings.  Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    Base = declarative_base()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

To Reproduce

make test

Expected behavior
No warning

Additional context
Sqlalchemy just released 2.0.0, I'm wondering if we should migrate to it 🤔

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions