Closed
Description
For personal reasons, I wanted to call the PandasCSVRenderer
on a dataframe outside of a view.
Because renderer_context
is defaulted to None
, the following code will throw TypeError: argument of type 'NoneType' is not iterable
:
from rest_pandas import renderers
data_frame = pandas.DataFrame(some_data)
print renderers.PandasCSVRenderer().render(data_frame)
>>>TypeError: argument of type 'NoneType' is not iterable
I suggest two options to fix the following code:
- Change the if statement:
if renderer_context and 'response' in renderer_context:
- Add the following at the top of the function:
if renderer_context is None:
renreder_context = {}
...
Metadata
Metadata
Assignees
Labels
No labels