Skip to content

Commit

Permalink
[fix] Resolve compatibility issues with sqlalchemy < 2.0 versions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mihran113 authored Jan 28, 2024
1 parent 631061b commit cf46d7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- Add `min/max/first` values tracking for metrics (mihran113)
- Fix bug in pytorch lightning raising lock timeout (inc0)

### Fixes
- Fix compatibility with `sqlalchemy < 2.0` versions

## 3.17.6

- Switch to patched version of official `pynvml` (mihran113)
Expand Down
3 changes: 2 additions & 1 deletion aim/storage/structured/sql_engine/entities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytz

from typing import Collection, Union, List, Optional
from sqlalchemy import __version__ as sa_version
from sqlalchemy import delete
from sqlalchemy.orm import joinedload
from sqlalchemy.exc import IntegrityError
Expand Down Expand Up @@ -29,7 +30,7 @@


def session_commit_or_flush(session):
if getattr(session, 'autocommit', True):
if getattr(session, 'autocommit', True) and sa_version >= '2.0.0':
session.commit()
else:
session.flush()
Expand Down

0 comments on commit cf46d7e

Please sign in to comment.