diff --git a/omnipath_server/loader/_legacy.py b/omnipath_server/loader/_legacy.py index 8a0a9f6..83bed03 100644 --- a/omnipath_server/loader/_legacy.py +++ b/omnipath_server/loader/_legacy.py @@ -13,6 +13,7 @@ # https://www.gnu.org/licenses/gpl-3.0.txt # +from typing import TYPE_CHECKING from collections.abc import Generator import re import bz2 @@ -24,6 +25,10 @@ from pypath_common import _misc from sqlalchemy.orm import decl_api +if TYPE_CHECKING: + + from sqlalchemy.sql.base import ReadOnlyColumnCollection + from .. import _log, _connection from ..schema import _legacy as _schema @@ -136,7 +141,7 @@ def _load_table(self, tbl: str): compr_path, schema, self.con, - wipe = self.wipe + wipe = self.wipe, ).load() _log( @@ -200,7 +205,7 @@ def load(self) -> None: @property - def columns(self) -> 'ReadOnlyColumnCollection': + def columns(self) -> ReadOnlyColumnCollection: return self.table.__table__.columns @@ -249,7 +254,7 @@ def _read(self) -> Generator[tuple, None, None]: sep = getattr( self.table, '_array_sep', - {} + {}, ).get(col, ';') row[col] = row[col].split(sep) if row[col] else []