Skip to content

Fix error in reports macro file#1604

Merged
mvdbeek merged 1 commit intogalaxyproject:masterfrom
bernt-matthias:macro-fix
Feb 2, 2026
Merged

Fix error in reports macro file#1604
mvdbeek merged 1 commit intogalaxyproject:masterfrom
bernt-matthias:macro-fix

Conversation

@bernt-matthias
Copy link
Collaborator

when testing against public instances I got

Traceback (most recent call last):
  File "/tmp/venv/bin/planemo", line 7, in <module>
    sys.exit(planemo())
             ^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/cli.py", line 146, in handle_blended_options
    return f(*args, **kwds)
           ^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/commands/cmd_test.py", line 76, in cli
    return_value = test_runnables(ctx, runnables, original_paths=uris, **kwds)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/engine/test.py", line 15, in test_runnables
    return handle_reports_and_summary(ctx, test_data.structured_data, kwds=kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 53, in handle_reports_and_summary
    handle_reports(ctx, structured_data, kwds)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 90, in handle_reports
    raise exceptions[0]
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 85, in handle_reports
    _handle_test_output_file(ctx, report_type, structured_data, kwds)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 111, in _handle_test_output_file
    contents = build_report.build_report(test_data, report_type=report_type, execution_type=execution_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/build_report.py", line 68, in build_report
    markdown = template_data(environment, "report_markdown.tpl")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/build_report.py", line 95, in template_data
    return template.render(**environment)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/report_markdown.tpl", line 81, in top-level template code
    {{render_steps(test.data.invocation_details.steps.values(), display_job_attributes)}}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
    rv = self._func(*arguments)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/macros.tmpl", line 13, in template
    {{      render_step_jobs(step_data, display_job_attributes) }}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
    rv = self._func(*arguments)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/macros.tmpl", line 32, in template
    {%          for metric in job.get('job_metrics', []) %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

@mvdbeek
Copy link
Member

mvdbeek commented Jan 30, 2026

new black at work here ... let me open a separate PR to fix this

when testing against public instances I got

```
Traceback (most recent call last):
  File "/tmp/venv/bin/planemo", line 7, in <module>
    sys.exit(planemo())
             ^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/decorators.py", line 93, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/cli.py", line 146, in handle_blended_options
    return f(*args, **kwds)
           ^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/commands/cmd_test.py", line 76, in cli
    return_value = test_runnables(ctx, runnables, original_paths=uris, **kwds)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/engine/test.py", line 15, in test_runnables
    return handle_reports_and_summary(ctx, test_data.structured_data, kwds=kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 53, in handle_reports_and_summary
    handle_reports(ctx, structured_data, kwds)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 90, in handle_reports
    raise exceptions[0]
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 85, in handle_reports
    _handle_test_output_file(ctx, report_type, structured_data, kwds)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/galaxy/test/actions.py", line 111, in _handle_test_output_file
    contents = build_report.build_report(test_data, report_type=report_type, execution_type=execution_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/build_report.py", line 68, in build_report
    markdown = template_data(environment, "report_markdown.tpl")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/build_report.py", line 95, in template_data
    return template.render(**environment)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/report_markdown.tpl", line 81, in top-level template code
    {{render_steps(test.data.invocation_details.steps.values(), display_job_attributes)}}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
    rv = self._func(*arguments)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/macros.tmpl", line 13, in template
    {{      render_step_jobs(step_data, display_job_attributes) }}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/jinja2/runtime.py", line 784, in _invoke
    rv = self._func(*arguments)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/venv/lib/python3.12/site-packages/planemo/reports/macros.tmpl", line 32, in template
    {%          for metric in job.get('job_metrics', []) %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
```
@bernt-matthias
Copy link
Collaborator Author

Good to go? Error seems to be a different one than in #1605 - but same file.

@mvdbeek mvdbeek merged commit 7ebd861 into galaxyproject:master Feb 2, 2026
13 of 14 checks passed
@bernt-matthias bernt-matthias deleted the macro-fix branch February 2, 2026 14:01
@bernt-matthias
Copy link
Collaborator Author

Thanks @mvdbeek should I create a new release? Or is there anything else you want to get in?

@mvdbeek
Copy link
Member

mvdbeek commented Feb 2, 2026

Sure, go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants