Skip to content

Commit

Permalink
Parse SA version #285
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Feb 17, 2024
1 parent b3dd945 commit 46482bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion clickhouse_sqlalchemy/drivers/native/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# Export connector version
VERSION = (0, 0, 2, None)

sqlalchemy_version = tuple(
(int(x) if x.isdigit() else x) for x in sqlalchemy_version.split('.')
)


class ClickHouseExecutionContext(ClickHouseExecutionContextBase):
def pre_exec(self):
Expand Down Expand Up @@ -53,7 +57,7 @@ def import_dbapi(cls):
return connector

def create_connect_args(self, url):
use_quote = sqlalchemy_version < '2.0.24'
use_quote = sqlalchemy_version < (2, 0, 24)

url = url.set(drivername='clickhouse')
if url.username:
Expand Down
2 changes: 1 addition & 1 deletion testsrequire.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

tests_require = [
'pytest',
'sqlalchemy>=2.0.25,<2.1.0',
'sqlalchemy>=2.0.0,<2.1.0',
'greenlet>=2.0.1',
'alembic',
'requests',
Expand Down

0 comments on commit 46482bf

Please sign in to comment.