From f4343d876f13e55e92ca228582b4430dcd01e4aa Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 Aug 2018 11:48:39 +0200 Subject: [PATCH] Clarify set_peek setting when finishing job --- lib/galaxy/jobs/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 7d9651e883d..790ad5b4bfb 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1375,11 +1375,13 @@ class JobWrapper(HasResourceParameters): return path dataset.metadata.from_JSON_dict(output_filename, path_rewriter=path_rewriter) + line_count = context.get('line_count', None) try: - assert context.get('line_count', None) is not None - dataset.set_peek(line_count=context['line_count']) - except Exception: - dataset.set_peek() + # Certain datatype's set_peek methods contain a line_count argument + dataset_assoc.dataset.set_peek(line_count=line_count) + except TypeError: + # ... and others don't + dataset_assoc.dataset.set_peek() else: # Handle purged datasets. dataset.blurb = "empty"