OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)

Home Page:https://open-mastr.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove deprecated functions

FlorianK13 opened this issue · comments

Several warnings appear when we run pytests:

  • test_utils_write_to_database.py:169: FutureWarning: Mismatched null-like values nan and None found. In a future version, pandas equality-testing functions (e.g. assert_frame_equal) will consider these not-matching and raise.
    pd.testing.assert_frame_equal(df_edited, df_correct)

  • DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    if rate and total else datetime.utcfromtimestamp(0))

  • zeep\cache.py:172: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)

  • zeep\cache.py:157: DeprecationWarning: The default timestamp converter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
    rows = cursor.fetchall()

  • open_mastr\utils\orm.py:17: MovedIn20Warning: The declarative_base() function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    Base = declarative_base(metadata=meta)

  • zeep\utils.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

    Maybe one of these warnings is reltated to #497

All zeep warnings are dependencies from within zeep and need to fixed there.

the function declarative_base is now a class: DeclerativeBase -> see https://docs.sqlalchemy.org/en/20/orm/quickstart.html