diff --git a/mindsdb_sql/parser/dialects/mindsdb/knowledge_base.py b/mindsdb_sql/parser/dialects/mindsdb/knowledge_base.py index 923f8908..6aa6c5bc 100644 --- a/mindsdb_sql/parser/dialects/mindsdb/knowledge_base.py +++ b/mindsdb_sql/parser/dialects/mindsdb/knowledge_base.py @@ -49,16 +49,19 @@ def to_tree(self, *args, level=0, **kwargs): return out_str def get_string(self, *args, **kwargs): - params = self.params.copy() - using_ar = [f"{k}={repr(v)}" for k, v in params.items()] from_query_str = ( f"FROM ({self.from_query.get_string()})" if self.from_query else "" ) + + using_ar = [] if self.storage: - using_ar.append(f" STORAGE = {self.storage.to_string()}") + using_ar.append(f" STORAGE={self.storage.to_string()}") if self.model: - using_ar.append(f" MODEL = {self.model.to_string()}") + using_ar.append(f" MODEL={self.model.to_string()}") + params = self.params.copy() + if params: + using_ar += [f"{k}={repr(v)}" for k, v in params.items()] if using_ar: using_str = "USING " + ", ".join(using_ar) else: