Skip to content

Commit 1a74380

Browse files
committed
add type annotation for SqlalchemyDataLayer
1 parent c1978f0 commit 1a74380

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flask_combo_jsonapi/data_layers/alchemy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""This module is a CRUD interface between resource managers and the sqlalchemy ORM"""
2+
from typing import TYPE_CHECKING
3+
4+
if TYPE_CHECKING:
5+
from sqlalchemy.orm import Session as SessionType
26

37
from sqlalchemy.orm.exc import NoResultFound
48
from sqlalchemy.orm.collections import InstrumentedList
@@ -33,6 +37,8 @@
3337

3438
class SqlalchemyDataLayer(BaseDataLayer):
3539
"""Sqlalchemy data layer"""
40+
if TYPE_CHECKING:
41+
session: "SessionType"
3642

3743
def __init__(self, kwargs):
3844
"""Initialize an instance of SqlalchemyDataLayer

0 commit comments

Comments
 (0)