Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ifcbdb/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import re
from io import BytesIO
import csv

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -95,7 +96,7 @@ def bin_in_dataset_or_404(bin, dataset):

def dataframe_csv_response(df, **kw):
csv_buf = BytesIO()
df.to_csv(csv_buf, mode='wb', **kw)
df.to_csv(csv_buf, mode="wb", quoting=csv.QUOTE_NONNUMERIC, **kw)
csv_buf.seek(0)
response = StreamingHttpResponse(csv_buf, content_type='text/csv')
return response
Expand Down
3 changes: 2 additions & 1 deletion ifcbdb/secure/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import csv
from io import BytesIO
from itertools import groupby
from operator import attrgetter
Expand Down Expand Up @@ -1034,7 +1035,7 @@ def bin_management_export(request, dataset_name=None):
filename = 'bins.csv'

csv_buf = BytesIO()
df.to_csv(csv_buf, mode='wb', index=None)
df.to_csv(csv_buf, mode='wb', quoting=csv.QUOTE_NONNUMERIC, index=None)
csv_buf.seek(0)

response = StreamingHttpResponse(csv_buf, content_type='text/csv')
Expand Down