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

Generator objects cannot be passed into CSVStreamingRenderer #69

Open
jrzerr opened this issue Nov 2, 2017 · 0 comments
Open

Generator objects cannot be passed into CSVStreamingRenderer #69

jrzerr opened this issue Nov 2, 2017 · 0 comments

Comments

@jrzerr
Copy link
Contributor

jrzerr commented Nov 2, 2017

CSVStreamingRenderer is great, it works as a generator along with tabelize which also works as a generator. However, you cannot pass a Generator object in as your data to be rendered. This code in CSVStreamingRenderer causes the issue:

        if not isinstance(data, list):
            data = [data]

A generator object is not a type list, so the if statement evaluates to true so this code breaks the renderer for a Generator object.

I have successfully used this with a generator as the data source by changing that to:

        if not isinstance(data, GeneratorType) and not isinstance(data, list):
            data = [data]

PR on it's way...

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