Repository: augerai/a2ml
Issue: monitor_evaluate_task should update error information in session

See _update_hub_leaderboad, it does not update error information

Changed files:
a2ml/api/auger/impl/experiment.py, a2ml/tasks_queue/tasks_hub_api.py, a2ml/api/auger/experiment.py, setup.py

diff --git a/a2ml/api/auger/experiment.py b/a2ml/api/auger/experiment.py
index a54dea7..bb4002f 100644
--- a/a2ml/api/auger/experiment.py
+++ b/a2ml/api/auger/experiment.py
@@ -64,7 +64,7 @@ class AugerExperiment(object):
         if run_id is None:
             run_id = self.ctx.config.get(
                 'experiment/experiment_session_id', None)
-        leaderboard, status, run_id, trials_count = Experiment(
+        leaderboard, status, run_id, trials_count, errors = Experiment(
             self.ctx, dataset, name).leaderboard(run_id)
         if leaderboard is None:
             raise AugerException('No leaderboard was found...')
@@ -78,13 +78,9 @@ class AugerExperiment(object):
             'started': 'Search is in progress...',
             'completed': 'Search is completed.',
             'interrupted': 'Search was interrupted.',
-            'error': 'Search was finished with error.'
+            'error': 'Search was finished with error'
         }
         message = messages.get(status, None)
-        if message:
-            self.ctx.log(message)
-        else:
-            self.ctx.log('Search status is %s' % status)
 
         result = {
             'run_id': run_id, 
@@ -94,10 +90,18 @@ class AugerExperiment(object):
             'provider_status': status
         }
 
-        if status == "error":
-            #TODO: get experiment session errors
-            result['error'] = message
-            #result['error_details'] = error_details
+        if status == "error" and errors:
+            result['error'] = errors.get('error')
+            result['error_details'] = errors.get('error_details')
+            message += ": " + result['error']
+            if result['error_details']:
+                message += "Details: " + result['error_details']
+
+        if message:
+            self.ctx.log(message)
+        else:
+            self.ctx.log('Search status is %s' % status)
+
         
         return result
 
diff --git a/a2ml/api/auger/impl/experiment.py b/a2ml/api/auger/impl/experiment.py
index a49585a..322c9bc 100644
--- a/a2ml/api/auger/impl/experiment.py
+++ b/a2ml/api/auger/impl/experiment.py
@@ -67,7 +67,9 @@ class Experiment(AugerExperimentApi):
                 self.ctx, None, None, run_id)
             session_props = session_api.properties()
             status = session_props.get('status')
-            return session_api.get_leaderboard(), status, run_id, session_props.get('model_settings', {}).get('completed_evaluations', 0)
+            return session_api.get_leaderboard(), status, run_id, \\
+                session_props.get('model_settings', {}).get('completed_evaluations', 0), \\
+                session_props.get('model_settings', {}).get('errors')
 
     def history(self):
         return AugerExperimentSessionApi(self.ctx, self).list()
diff --git a/a2ml/tasks_queue/tasks_hub_api.py b/a2ml/tasks_queue/tasks_hub_api.py
index 2f4b8c3..7d79798 100644
--- a/a2ml/tasks_queue/tasks_hub_api.py
+++ b/a2ml/tasks_queue/tasks_hub_api.py
@@ -312,6 +312,7 @@ def _get_leaderboad(params):
         evaluate_status = {
             'status': status,
             'completed_evaluations': trials_count,
+            'errors' : {'error': data.get('error'), 'error_details': data.get('error_details')}
         }
 
         return {
diff --git a/setup.py b/setup.py
index 317d04f..6464049 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ from setuptools import setup
 from setuptools import find_packages
 from setuptools.command.install import install
 
-VERSION = '0.5.0.rc7'
+VERSION = '0.5.0.rc8'
 
 # Get the long description from the README file
 here = os.path.abspath(os.path.dirname(__file__))