Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to logger when scoring is errored #141

Merged
merged 1 commit into from May 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion ores/score_processors/score_processor.py
Expand Up @@ -59,7 +59,7 @@ def _get_root_ds(self, context, model, rev_ids, caches=None):
start = time.time()
roots = scoring_context.extract_roots(model, rev_ids, caches=caches)
duration = time.time() - start
logger.debug("Extracted root datasources for " +
logger.debug("Extracted root datasources for "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not using an explicit "+" for concatenation not recommended? I've been looking for something that would tell us about a best practice here and I can't find anything.

"{0}:{1}:{2}:{3} in {4} secs"
.format(context, model, version, rev_ids, duration))

Expand All @@ -69,6 +69,9 @@ def _get_root_ds(self, context, model, rev_ids, caches=None):

for error, cache in roots.values():
if error is not None:
logger.error("Errored while getting root datasource "
"for {0}:{1}:{2}:{3}"
.format(context, model, version, rev_ids))
self.metrics_collector.score_errored(context, model, version)

return roots
Expand All @@ -92,6 +95,8 @@ def _process(self, context, model, cache, include_features=False):
duration)
except:
self.metrics_collector.score_errored(context, model, version)
logger.error("Errored while scoring {0}:{1}:{2}"
.format(context, model, version))
raise

return score, feature_vals
Expand Down