Skip to content

Commit

Permalink
fix describe model.version.attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ea-rus committed Jan 10, 2024
1 parent 14f6091 commit ec67e69
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mindsdb_sql/parser/dialects/mindsdb/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class MindsDBLexer(Lexer):
def ID(self, t):
return t

@_(r'\d+\.\d*')
@_(r'\d+\.\d+')
def FLOAT(self, t):
return t

Expand Down
25 changes: 25 additions & 0 deletions tests/test_parser/test_base_sql/test_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,28 @@ def test_describe_predictor(self):
assert str(ast) == str(expected_ast)
assert ast.to_tree() == expected_ast.to_tree()

# describe attr
sql = "DESCRIBE MODEL pred.attr"
ast = parse_sql(sql, dialect='mindsdb')

expected_ast = Describe(type='predictor', value=Identifier(parts=['pred', 'attr']))

assert str(ast) == str(expected_ast)

# version
sql = "DESCRIBE MODEL pred.11"
ast = parse_sql(sql, dialect='mindsdb')

expected_ast = Describe(type='predictor', value=Identifier(parts=['pred', '11']))

assert str(ast) == str(expected_ast)

# version and attr
sql = "DESCRIBE MODEL pred.11.attr"
ast = parse_sql(sql, dialect='mindsdb')

expected_ast = Describe(type='predictor', value=Identifier(parts=['pred', '11', 'attr']))

assert str(ast) == str(expected_ast)


0 comments on commit ec67e69

Please sign in to comment.