-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot create model #77
Comments
Can you share the code example please? |
@radiantone, here is data['query'] a string? If yes, you need to add 'database' param. If query have to be executed in context of mindsdb, please add database='mindsdb'. It should help |
Let's close it and open again when we have more information |
Hi sir, I can't create a model either, I get an error after using models.create.
ERROR:
I've looked for a lot of examples and issues that can't solve my problem. Here's my code: CODE |
@kiuyaku, please try to update mindsdb_sql to the latest version |
This could be the cause: #129 |
OK! thank you very much! |
Does this SDK work at all? Seems like its broken
Tried to create a model using a simple SQL query "select * from prices" and looks like its introducing parens or something.
Python version: 3.10.12
Operating system: Pop!_OS(Ubuntu) 22.04
Mindsdb Python SDK version:
mindsdb-sdk==1.0.4
mindsdb-sql==0.6.7
Additional info if applicable:
Please describe your issue and how we can replicate it
File "/home/darren/PycharmProjects/pyfi/pyfi/server/api.py", line 1747, in create_model
project.create_model(name=model, predict=data["column"], query=data['query'])
File "/home/darren/PycharmProjects/pyfi/venv/lib/python3.10/site-packages/mindsdb_sdk/project.py", line 410, in create_model
df = self.query(ast_query.to_string()).fetch()
File "/home/darren/PycharmProjects/pyfi/venv/lib/python3.10/site-packages/mindsdb_sdk/query.py", line 29, in fetch
return self.api.sql_query(self.sql, self.database)
File "/home/darren/PycharmProjects/pyfi/venv/lib/python3.10/site-packages/mindsdb_sdk/connectors/rest_api.py", line 11, in wrapper
return fnc(self, *args, **kwargs)
File "/home/darren/PycharmProjects/pyfi/venv/lib/python3.10/site-packages/mindsdb_sdk/connectors/rest_api.py", line 82, in sql_query
raise RuntimeError(data['error_message'])
RuntimeError: SQL statement cannot be parsed by mindsdb_sql - CREATE PREDICTOR modeltest (select * from prices) PREDICT prices: Syntax error at token LPAREN: "("
The text was updated successfully, but these errors were encountered: