Skip to content

Commit

Permalink
Merge pull request #80 from sdrenn/minor-fix
Browse files Browse the repository at this point in the history
named arguments should go after positional
  • Loading branch information
xzkostyan committed Feb 15, 2020
2 parents 2162dd9 + 59e3fb8 commit 76ec893
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion clickhouse_sqlalchemy/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ def get_parameters(self):

class ReplacingMergeTree(MergeTree):
def __init__(self,
version_col=None,
*args,
**kwargs):

version_col = kwargs.pop('version_col', None)
super(ReplacingMergeTree, self).__init__(
*args, **kwargs
)
Expand Down
7 changes: 4 additions & 3 deletions tests/test_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ class TestTable(self.base):

__table_args__ = (
engines.ReplacingMergeTree(
'version',
'date',
('date', 'x'),
version_col='version',
),
)

Expand All @@ -274,7 +274,8 @@ class TestTable(self.base):
__table_args__ = (
engines.ReplicatedReplacingMergeTree(
'/table/path', 'name',
'version', 'date', ('date', 'x'),
'date', ('date', 'x'),
version_col='version',
),
)

Expand All @@ -299,7 +300,7 @@ class TestTable(self.base):

__table_args__ = (
engines.ReplacingMergeTree(
version,
version_col=version,
partition_by=func.toYYYYMM(date),
order_by=(date, x),
),
Expand Down

0 comments on commit 76ec893

Please sign in to comment.