From 813b427cc97d1e7f5289c54415a30b4e9f0db564 Mon Sep 17 00:00:00 2001 From: yqkcn <410728991@qq.com> Date: Fri, 10 Mar 2023 13:54:40 +0800 Subject: [PATCH] change default argument value --- kylinpy/kylindb.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kylinpy/kylindb.py b/kylinpy/kylindb.py index 8da4f8128..f3870ca2d 100644 --- a/kylinpy/kylindb.py +++ b/kylinpy/kylindb.py @@ -37,7 +37,9 @@ def description(self): c['isNullable'], ] for c in self._column_metas) - def execute(self, query, parameters={}): + def execute(self, query, parameters=None): + if parameters is None: + parameters = {} resp = self.connection.query(query, **parameters) self._column_metas = resp.get('columnMetas') @@ -48,7 +50,9 @@ def execute(self, query, parameters={}): self.rowcount = len(self.results) self.fetched_rows = 0 - def executemany(self, query, seq_params=[]): + def executemany(self, query, seq_params=None): + if seq_params is None: + seq_params = [] results = [] for param in seq_params: self.execute(query, param)