Arafath10 commited on
Commit
0371cd5
·
verified ·
1 Parent(s): eb151cd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -17,7 +17,7 @@ app.add_middleware(
17
  allow_headers=["*"],
18
  )
19
 
20
- def insert_data(bid,forecast_data):#mysql-connector-python
21
  import mysql.connector
22
  import json
23
 
@@ -46,7 +46,7 @@ def insert_data(bid,forecast_data):#mysql-connector-python
46
  """
47
 
48
  # Execute the SQL command with data
49
- cursor.execute(insert_query, (bid, forecast_data_json))
50
 
51
  # Commit the transaction
52
  connection.commit()
@@ -230,7 +230,7 @@ async def generate_product_count_prediction(b_id: int):
230
 
231
 
232
  delete_json(b_id)
233
- insert_data(bid,results)
234
  return {"status": "success",
235
  "b_id":b_id,
236
  "message": "Prediction successful and saved to DB",
 
17
  allow_headers=["*"],
18
  )
19
 
20
+ def insert_data(b_id,forecast_data):#mysql-connector-python
21
  import mysql.connector
22
  import json
23
 
 
46
  """
47
 
48
  # Execute the SQL command with data
49
+ cursor.execute(insert_query, (b_id, forecast_data_json))
50
 
51
  # Commit the transaction
52
  connection.commit()
 
230
 
231
 
232
  delete_json(b_id)
233
+ insert_data(b_id,results)
234
  return {"status": "success",
235
  "b_id":b_id,
236
  "message": "Prediction successful and saved to DB",