Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Resolve mypy reported unknown Session type #244

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/ert_storage/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from typing import Any

import sqlalchemy.orm.Session as sqlalchemy_session
from fastapi import Depends
from sqlalchemy import create_engine
from sqlalchemy.exc import DBAPIError
Expand Down Expand Up @@ -31,8 +32,10 @@ def get_env_rdbms() -> str:
engine = create_engine(URI_RDBMS, connect_args={"check_same_thread": False})
else:
engine = create_engine(URI_RDBMS, pool_size=50, max_overflow=100)
Session = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Session: sqlalchemy_session = sessionmaker(
autocommit=False, autoflush=False, bind=engine
)

Base = declarative_base()

Expand Down