Skip to content

Commit 3ca818a

Browse files
committed
PR from branch users/gvit/refactor-modules
ref:9050248 sync: https://proxy.sandbox.yandex-team.ru/2714423438
1 parent ab163d9 commit 3ca818a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

ydb/sqlalchemy/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
from __future__ import absolute_import, unicode_literals
77

8-
import ydb
9-
from ydb.dbapi.errors import NotSupportedError
10-
from ydb.sqlalchemy.types import UInt32, UInt64
11-
128

139
try:
10+
import ydb
11+
from ydb.dbapi.errors import NotSupportedError
12+
from ydb.sqlalchemy.types import UInt32, UInt64
13+
1414
from sqlalchemy.engine.default import DefaultDialect
1515
from sqlalchemy.sql.compiler import (
1616
IdentifierPreparer,

ydb/sqlalchemy/types.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
from sqlalchemy import types
2-
from sqlalchemy.sql import type_api
3-
from sqlalchemy.sql.elements import ColumnElement
4-
from sqlalchemy import util, exc
1+
try:
2+
from sqlalchemy.types import Integer
3+
from sqlalchemy.sql import type_api
4+
from sqlalchemy.sql.elements import ColumnElement
5+
from sqlalchemy import util, exc
6+
except ImportError:
7+
Integer = object
8+
ColumnElement = object
59

610

7-
class UInt32(types.Integer):
11+
class UInt32(Integer):
812
__visit_name__ = "uint32"
913

1014

11-
class UInt64(types.Integer):
15+
class UInt64(Integer):
1216
__visit_name__ = "uint64"
1317

1418

15-
class UInt8(types.Integer):
19+
class UInt8(Integer):
1620
__visit_name__ = "uint8"
1721

1822

0 commit comments

Comments
 (0)