Skip to content

Commit

Permalink
Bug fix with Table names
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshhewabi committed Feb 20, 2024
1 parent bfdd033 commit e15bb30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/routes/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def write_data(
data[i] = spectra
i += 1

table = Table(table, meta, autoload_with=engine)
table = Table(table.name, meta, autoload_with=engine)
with engine.connect() as conn:
statement = table.insert().values(data)
result = conn.execute(statement)
Expand Down Expand Up @@ -125,7 +125,7 @@ def write_mzid_info(analysis_software_list=Body(..., embeded=True),
:param bib:
:return:
"""
upload = Table("upload", meta, autoload_with=engine, quote=False)
upload = Table(TableNamesEnum.upload.name, meta, autoload_with=engine, quote=False)
stmt = upload.update().where(upload.c.id == str(upload_id)).values(
analysis_software_list=analysis_software_list,
spectra_formats=spectra_formats,
Expand Down Expand Up @@ -156,7 +156,7 @@ def write_other_info(contains_crosslinks=Body(..., description="contains_crossli
:return:
"""

upload = Table("upload", meta, autoload_with=engine, quote=False)
upload = Table(TableNamesEnum.upload.name, meta, autoload_with=engine, quote=False)
with engine.connect() as conn:
stmt = upload.update().where(upload.c.id == str(upload_id)).values(
contains_crosslinks=contains_crosslinks,
Expand Down

0 comments on commit e15bb30

Please sign in to comment.