How to use "training_options" in SQL Insert

Hi, I am using MySQL as back end DB, and I am trying to train new model example by using script (INSERT INTO mindsdb.predictors(name, predict, select_data_query,training_options)
VALUES (‘passenger_satisfaction_model’, ‘satisfaction’, ‘SELECT * FROM public.airline_passenger_satisfaction’, ‘{“ignore_columns”:“id”}’);).
It was running without error, but when I try to get the prediction by running (SELECT satisfaction AS predicted, satisfaction_confidence AS confidence FROM mindsdb.passenger_satisfaction_model WHERE when_data=’{“Customer Type”: “Loyal Customer”, “Inflight wifi service”:5, “Type of Travel”:“Business travel”, “Class”: “Eco”}’;). I got below error, does anyone know why? BTW, if I train same model without (" ‘{“ignore_columns”:“id”}’)"), working fine. FYI. Thanks!

Below is error message —
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 4904 and this is thread id 5828.
ERROR while fetching data for query: SELECT Column1, Gender, Customer Type, Age, Type of Travel, Class, Flight Distance, Inflight wifi service, Departure/Arrival time convenient, Ease of Online booking, Gate location, Food and drink, Online boarding, Seat comfort, Inflight entertainment, On-board service, Leg room service, Baggage handling, Checkin service, Inflight service, Cleanliness, Departure Delay in Minutes, Arrival Delay in Minutes, satisfaction, satisfaction_original, when_data, select_data_query, external_datasource, satisfaction_confidence, satisfaction_explain FROM passenger_satisfaction_model WHERE (when_data = ‘{“Customer Type”: “Loyal Customer”, “Inflight wifi service”:5, “Type of Travel”:“Business travel”, “Class”: “Eco”}’)
Traceback (most recent call last):
File “C:\PROGRA~1\MindsDB\python\lib\site-packages\mindsdb\api\mysql\mysql_proxy\classes[sql_query.py](http://sql_query.py/)”, line 68, in fetch
self._fetchData()
File “C:\PROGRA~1\MindsDB\python\lib\site-packages\mindsdb\api\mysql\mysql_proxy\classes[sql_query.py](http://sql_query.py/)”, line 440, in _fetchData
came_from=self.integration
File “C:\PROGRA~1\MindsDB\python\lib\site-packages\mindsdb\api\mysql\mysql_proxy\datahub\datanodes[mindsdb_datanode.py](http://mindsdb_datanode.py/)”, line 220, in select
for f in model[‘columns’] if ‘typing’ in model[‘data_analysis_v2’][f]
File “C:\PROGRA~1\MindsDB\python\lib\site-packages\mindsdb\api\mysql\mysql_proxy\datahub\datanodes[mindsdb_datanode.py](http://mindsdb_datanode.py/)”, line 220, in
for f in model[‘columns’] if ‘typing’ in model[‘data_analysis_v2’][f]
KeyError: ‘id’

‘id’

Thanks for reporting this. I was able to reproduce it and created an issue, so we will solve this in the new version.

1 Like