Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

[FIX] Added fix for NoneType issue occuring in cost logs (#1252)

Praveen Kumar52d7ce3e3e2b
diff --git a/backend/workflow_manager/workflow_v2/execution.py b/backend/workflow_manager/workflow_v2/execution.py
index a10441210..f3415426c 100644
--- a/backend/workflow_manager/workflow_v2/execution.py
+++ b/backend/workflow_manager/workflow_v2/execution.py
@@ -334,7 +334,7 @@ class WorkflowExecutionServiceHelper(WorkflowExecutionService):
def log_total_cost_per_file(self, run_id, file_name):
cost_dict = UsageHelper.get_aggregated_token_count(run_id=run_id)
- cost = round(cost_dict.get("cost_in_dollars", 0), 5)
+ cost = round(cost_dict.get("cost_in_dollars") or 0, 5)
# Log the total cost for a particular file executed in the workflow
self.publish_log(message=f"Total cost for file '{file_name}' is '${cost}'")