Skip to content

Commit

Permalink
sqlalchemy 2.0 support
Browse files Browse the repository at this point in the history
- Change util.callable with builtin callable
  • Loading branch information
PedroAquilino committed Sep 4, 2023
1 parent 8694e7f commit aa2fffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion clickhouse_sqlalchemy/ext/clauses.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Lambda(ColumnElement):
__visit_name__ = 'lambda'

def __init__(self, func):
if not util.callable(func):
if not callable(func):
raise exc.ArgumentError('func must be callable')

self.type = type_api.NULLTYPE
Expand Down
12 changes: 3 additions & 9 deletions clickhouse_sqlalchemy/sql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@


class Table(TableBase):
def drop(self, bind=None, checkfirst=False, if_exists=False):
if bind is None:
bind = self.bind
def drop(self, bind, checkfirst=False, if_exists=False):
bind._run_ddl_visitor(ddl.SchemaDropper, self,
checkfirst=checkfirst, if_exists=if_exists)

Expand Down Expand Up @@ -115,14 +113,10 @@ def __repr__(self):

return 'MaterializedView(%s)' % ', '.join(args)

def create(self, bind=None, checkfirst=False, if_not_exists=False):
if bind is None:
bind = self.bind
def create(self, bind, checkfirst=False, if_not_exists=False):
bind._run_ddl_visitor(ddl.SchemaGenerator, self, checkfirst=checkfirst,
if_not_exists=if_not_exists)

def drop(self, bind=None, checkfirst=False, if_exists=False):
if bind is None:
bind = self.bind
def drop(self, bind, checkfirst=False, if_exists=False):
bind._run_ddl_visitor(ddl.SchemaDropper, self, checkfirst=checkfirst,
if_exists=if_exists)

0 comments on commit aa2fffc

Please sign in to comment.