Skip to content

Commit

Permalink
change from_query to from_select
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhuishi-convect committed Sep 1, 2023
1 parent bc09c26 commit 37ef94c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mindsdb_sql/parser/dialects/mindsdb/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(
name,
model,
storage,
from_query=None,
from_select=None,
params=None,
if_not_exists=False,
*args,
Expand All @@ -20,7 +20,7 @@ def __init__(
self.storage = storage
self.params = params
self.if_not_exists = if_not_exists
self.from_query = from_query
self.from_query = from_select

def to_tree(self, *args, level=0, **kwargs):
ind = indent(level)
Expand Down
2 changes: 1 addition & 1 deletion mindsdb_sql/parser/dialects/mindsdb/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def create_kb(self, p):
name=name,
model=model,
storage=storage,
from_query=from_query,
from_select=from_query,
params=params,
if_not_exists=if_not_exists
)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_parser/test_mindsdb/test_knowledgebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_create_knowledeg_base():
if_not_exists=False,
model=Identifier(parts=["mindsdb", "my_embedding_model"]),
storage=Identifier(parts=["my_vector_database", "some_table"]),
from_query=None,
from_select=None,
params={},
)
assert ast == expected_ast
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_create_knowledeg_base():
if_not_exists=False,
model=Identifier(parts=["mindsdb", "my_embedding_model"]),
storage=Identifier(parts=["my_vector_database", "some_table"]),
from_query=Select(
from_select=Select(
targets=[
Identifier("id"),
Identifier("content"),
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_create_knowledeg_base():
if_not_exists=True,
model=Identifier(parts=["mindsdb", "my_embedding_model"]),
storage=Identifier(parts=["my_vector_database", "some_table"]),
from_query=None,
from_select=None,
params={},
)
assert ast == expected_ast
Expand All @@ -133,7 +133,7 @@ def test_create_knowledeg_base():
if_not_exists=False,
model=Identifier(parts=["mindsdb", "my_embedding_model"]),
storage=Identifier(parts=["my_vector_database", "some_table"]),
from_query=None,
from_select=None,
params={"some_param": "some value", "other_param": "other value"},
)
assert ast == expected_ast
Expand Down

0 comments on commit 37ef94c

Please sign in to comment.