spotify/luigi — pull request #332 by mikepii (2014-05-20 17:43:51+00:00)
Title: Support strings in luigi.task.flatten()

I pretty often make the mistake of returning a list of strings instead of a list of HdfsTarget from JobTask.hadoop_input(). The unhelpful error message is:

RuntimeError: maximum recursion depth exceeded while calling a Python object

This is because of ducktyping in flatten() that treats strings as lists and it recurses into them. This causes an infinite loop. Supporting strings in flatten(), the new error message is more helpful:

```
File "/.../luigi/luigi/hadoop.py", line 411, in run_job
assert isinstance(target, luigi.hdfs.HdfsTarget)
AssertionError
```