We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cbb16d commit 3393e76Copy full SHA for 3393e76
mfr/extensions/tabular/utilities.py
@@ -1,5 +1,6 @@
1
import re
2
import xlrd
3
+from datetime import datetime
4
5
from http import HTTPStatus
6
from subprocess import (check_call,
@@ -114,12 +115,18 @@ def to_bytes(fp):
114
115
raise TypeError("Expected binary file-like object; got text/str")
116
117
118
+def _convert_value(value):
119
+ if isinstance(value, datetime):
120
+ return value.isoformat()
121
+ return value
122
+
123
124
def _extract_rows(fields, raw_rows):
125
rows = []
126
for row in raw_rows:
127
if len(rows) >= MAX_SIZE:
128
break
- rows.append(dict(zip(fields, row)))
129
+ rows.append(dict(zip(fields, map(_convert_value, row))))
130
return rows
131
132
0 commit comments