Skip to content

Commit

Permalink
check if the df is empty or not;
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjan-stha committed Aug 3, 2023
1 parent 6266df7 commit e5f2539
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions core/tasks/model_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,33 @@ def save_model_performance(df: pl.DataFrame):
logger.info("Saving Model Performance")
modelperf = ModelPerformance(df)
modelperf.label_transform()

df1 = modelperf.projectwise_perf_metrics()
save_dataframe_to_model(df1, ProjectWisePerfMetrics)
if not df1.is_empty():
save_dataframe_to_model(df1, ProjectWisePerfMetrics)
else:
logger.info("Empty project wise performance data")

df2 = modelperf.per_tag_perf_metrics()
if df2 is not None:
save_dataframe_to_model(df2, TagWisePerfMetrics)
if not df2.is_empty():
save_dataframe_to_model(df2, TagWisePerfMetrics)
else:
logger.info("Empty tag performance data")
logger.info("Empty tag performance data")

df3 = modelperf.overall_projects_perf_metrics()
if df3 is not None:
if not df3.is_empty():
save_dataframe_to_model(df3, AllProjectPerfMetrics)
else:
logger.info("Empty project performance data")

df4 = modelperf.calculate_ratios()
if df4 is not None:
if not df4.is_empty():
save_dataframe_to_model(df4, CategoryWiseMatchRatios)
else:
logger.info("Empty ratio data")

df5 = modelperf.per_project_calc_ratios()
if df5 is not None:
if not df5.is_empty():
save_dataframe_to_model(df5, ProjectWiseMatchRatios)
else:
logger.info("Empty per project ratio data")
Expand Down

0 comments on commit e5f2539

Please sign in to comment.