mindsdb / mindsdb

The platform for building AI from enterprise data
https://mindsdb.com
Other
26.68k stars 4.87k forks source link

[Bug]: Error in the logs when creating a predictor #3389

Closed spullara closed 1 year ago

spullara commented 2 years ago

Is there an existing issue for this?

Current Behavior

When I create a predictor I see this error in the log:

2022-10-14 18:38:45,972 - ERROR - ERROR:mindsdb.api.http.initialize:Exception on /api/analysis/data [POST]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/conda/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/conda/lib/python3.7/site-packages/flask_restx/api.py", line 403, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/flask_restx/resource.py", line 49, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/mindsdb/api/http/namespaces/analysis.py", line 96, in post
    data_frame=DataFrame(data, columns=column_names)
  File "/opt/conda/lib/python3.7/site-packages/mindsdb/integrations/handlers/lightwood_handler/lightwood_handler/lightwood_handler.py", line 187, in analyze_dataset
    analysis = lightwood.analyze_dataset(data_frame)
  File "/opt/conda/lib/python3.7/site-packages/lightwood/api/high_level.py", line 125, in analyze_dataset
    problem_definition = ProblemDefinition.from_dict({'target': str(df.columns[0])})
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4604, in __getitem__
    return getitem(key)
IndexError: index 0 is out of bounds for axis 0 with size 0

Expected Behavior

It seems benign but this is still probably a bug.

Steps To Reproduce

Spin up the docker container
Run the housing price tutorial

Anything else?

No response

yagueto commented 2 years ago

I've run into the same issue- every time I try to create a predictor in the web GUI it returns the error unexpected EOF while parsing (<unknown>, line 1) followed by the above error in the docker logs.

I'm using a MongoDB database.

ZoranPandovski commented 2 years ago

Hey @yagueto MindsDB SQL Editor is only for SQL commands, for mongo you need to use mongo-client or mongo compass

yagueto commented 2 years ago

Ah, okay 🙃

Ricram2 commented 1 year ago

It seems issue was identified. closing, feel free to reopen if necessary.