python-bonobo / bonobo

Extract Transform Load for Python 3.5+
https://www.bonobo-project.org/
Apache License 2.0
1.59k stars 146 forks source link

CsvWriter does not write headers #306

Closed joseph-holland closed 5 years ago

joseph-holland commented 5 years ago

Versions

Issue

Code to replicate:

def get_graph(**options):
    graph = bonobo.Graph()
    graph.add_chain(
        extract,
        transform,
        bonobo.CsvWriter('output.csv', fields=('header1', 'header2', 'header3', 'header4'))
    )
    return graph
joseph-holland commented 5 years ago

Hi,

I can see that this issue is already fixed in latest develop branch csv.py

  fields = context.get_input_fields() if self.fields is None else self.fields

Closing this issue.

Thanks, Joe