Dataframe extension integration

This is just a function to avoid duplicating the logic (it is used both in _get_csv and _finish_csv.  I will add a bit of documentation).  Let me know if you can think of a better way to do this.