Skip to content

Commit 297a842

Browse files
committed
#790 Cleaned up unused code
1 parent acc167b commit 297a842

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/backend_api/app/plotting/plotter.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -632,18 +632,9 @@ def _create_plot_statement(self, query: IdentifiedPlotQuery) -> Select:
632632
return final_query
633633

634634
async def _plot_execute(self, db: AsyncSession, *, statement: Select) -> PlotData:
635-
print(statement)
636635
result = await self._perform_plot_db_statement(db, statement=statement)
637-
df = self._convert_result_to_df(result)
638-
639-
if df.empty:
640-
raise PlotQueryDataNotFoundError(
641-
query_data=str(statement),
642-
function_name=self.plot.__name__,
643-
class_name=self.__class__.__name__,
644-
)
645636

646-
return self._create_plot_data(df)
637+
return result.first()
647638

648639
def _convert_plot_query_type(self, query: PlotQuery) -> IdentifiedPlotQuery:
649640
query_dump = query.model_dump()
@@ -661,16 +652,7 @@ async def plot(self, db: AsyncSession, *, query: PlotQuery) -> PlotData:
661652
log_clause = stmt.compile(engine, compile_kwargs={"literal_binds": True})
662653
plot_logger.info(f"{log_clause}")
663654

664-
result = await self._perform_plot_db_statement(db, statement=stmt)
665-
# (temp,) = result.fetchone()
666-
# print(temp)
667-
# return temp
668-
# return result.scalar()
669-
# return result.fetchone()
670-
return result.first()
671-
# return result.fetchone()
672-
# return result.scalar_one()
673-
# return await self._plot_execute(db, statement=stmt)
655+
return await self._plot_execute(db, statement=stmt)
674656

675657

676658
class UnidentifiedPlotter(_BasePlotter):

0 commit comments

Comments
 (0)