datacipen commited on
Commit
466a836
1 Parent(s): 148b1c6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -51,8 +51,8 @@ async def on_chat_start():
51
  idDb = random.randrange(0, 1001, 3)
52
  if cl.user_session.get("createdb") == None:
53
  df = pd.read_csv("https://cipen.univ-gustave-eiffel.fr/typo3conf/ext/cipen_package/Resources/Public/Dataviz/datalab/crossfilterings/enquete-DClic-juin2022-dataviz-ord1.csv")
54
- engine = create_engine("sqlite:///epnum" + idDb + ".db")
55
- df.to_sql("epnum" + idDb, engine, index=False)
56
  db = SQLDatabase(engine=engine)
57
  cl.user_session.set("createdb", "OK")
58
  cl.user_session.set("db", db)
 
51
  idDb = random.randrange(0, 1001, 3)
52
  if cl.user_session.get("createdb") == None:
53
  df = pd.read_csv("https://cipen.univ-gustave-eiffel.fr/typo3conf/ext/cipen_package/Resources/Public/Dataviz/datalab/crossfilterings/enquete-DClic-juin2022-dataviz-ord1.csv")
54
+ engine = create_engine("sqlite:///epnum" + str(idDb) + ".db")
55
+ df.to_sql("epnum" + str(idDb), engine, index=False)
56
  db = SQLDatabase(engine=engine)
57
  cl.user_session.set("createdb", "OK")
58
  cl.user_session.set("db", db)