Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Resolve compatibility issues with sqlalchemy < 2.0 versions #3096

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading