Skip to content

Commit

Permalink
feat: improve audit columns
Browse files Browse the repository at this point in the history
  • Loading branch information
johanseto committed Jun 28, 2024
1 parent f95f96b commit b7953ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions eox_nelp/pearson_vue/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@
from eox_nelp.signals.utils import get_completed_and_graded

try:
from eox_audit_model.decorators import audit_method
from eox_audit_model.decorators import audit_method, rename_function
except ImportError:
def audit_method(action): # pylint: disable=unused-argument
"""Identity audit_method"""
return lambda x: x
def rename_function(name): # pylint: disable=unused-argument
"""Identity rename_function"""
return lambda x: x


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -491,8 +494,10 @@ def audit_pearson_error(failed_step_pipeline="", exception_dict=None, **kwargs):
if not failed_step_pipeline:
failed_step_pipeline = exception_dict.get("pipe_function")

audit_action = f"Pearson Vue Exception~{exception_dict['exception_type']}"
exception_title = ' '.join(word.capitalize() for word in exception_dict['exception_type'].split('-'))
audit_action = f"Pearson Vue Exception: {exception_title}"

@rename_function(name=failed_step_pipeline)
@audit_method(action=audit_action)
def raise_audit_pearson_exception(exception_dict, failed_step_pipeline):
raise PearsonBaseError.from_dict(exception_dict)
Expand Down

0 comments on commit b7953ff

Please sign in to comment.