Skip to content

Commit

Permalink
Merge pull request #435 from RelevanceAI/development
Browse files Browse the repository at this point in the history
v0.31.2
  • Loading branch information
jtwinrelevanceai authored May 24, 2023
2 parents a14afa2 + afc9b9a commit 85be02c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ai_transform/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.31.1"
__version__ = "0.31.2"

from ai_transform.timer import Timer

Expand Down
14 changes: 6 additions & 8 deletions ai_transform/workflow/context_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
import logging
import requests

from inspect import Traceback
from typing import Dict, Any, List
Expand All @@ -10,14 +8,12 @@
from ai_transform.dataset import dataset
from ai_transform.operator import abstract_operator
from ai_transform.engine import abstract_engine
from ai_transform.logger import format_logging_info
from ai_transform.api.wrappers import request_wrapper
from ai_transform.errors import UserFacingError
from ai_transform.logger import ic

WORKFLOW_FAIL_MESSAGE = (
"Workflow processed {:.2f}%" + " of documents. This is less than the success threshold of {:.2f}%"
)

WORKFLOW_PROCESSED_MESSAGE = "Workflow processed {:.2f}%" + " of documents. "

WORKFLOW_FAIL_MESSAGE = WORKFLOW_PROCESSED_MESSAGE + "This is less than the success threshold of {:.2f}%"


class WorkflowContextManager:
Expand Down Expand Up @@ -194,6 +190,8 @@ def __exit__(self, exc_type: type, exc_value: BaseException, traceback: Tracebac
user_errors = None

if self.engine is not None:
self.addtional_message = WORKFLOW_PROCESSED_MESSAGE.format(100 * self.engine.success_ratio)

regular_workflow_failed = self.engine.success_ratio < self.success_threshold

if regular_workflow_failed:
Expand Down

0 comments on commit 85be02c

Please sign in to comment.