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

get_all_output_file_names raises AttributeError for tasks with no output #169

Open
meliache opened this issue Apr 7, 2022 · 0 comments
Open

Comments

@meliache
Copy link
Collaborator

meliache commented Apr 7, 2022

I stupidly tried get_all_output_file_names (by @anselm-baur ) on a WrapperTask and got error

Traceback (most recent call last):
  File "run_naf_reconstruction.py", line 86, in <module>
    output_files_str = "\n  ".join(task.get_all_output_file_names())
  File "/afs/desy.de/user/m/meliache/.local/lib/python3.8/site-packages/b2luigi/core/task.py", line 174, in get_all_output_file_names
    for file_names in self._transform_output(self.output()).values():
AttributeError: 'NoneType' object has no attribute 'values'

I think it's clear that that output is not really defined for a wrapper task, though it seems that self._transform_output can deal with that and just returns None.

But from a user-experience point of view, if a task has no output, I personally would expect the function to just return an empty list in the case of missing outputs. Not sure if others would expect/prefer the same, but I would try to go with the principle of least surprise and if give an error message, give some more useful one.

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

No branches or pull requests

1 participant