@@ -21,7 +21,7 @@ def encode_in_py2(s):
21
21
import signal
22
22
import requests
23
23
import subprocess
24
- import ujson
24
+ import json
25
25
import logging
26
26
import shlex
27
27
import datetime
@@ -198,17 +198,17 @@ def _processor(self, data):
198
198
item ['doc' ].pop (field )
199
199
except KeyError :
200
200
pass
201
- meta = ujson .dumps ({item ['action' ]: action_content })
201
+ meta = json .dumps ({item ['action' ]: action_content })
202
202
if item ['action' ] == 'index' :
203
- body = ujson .dumps (item ['doc' ])
203
+ body = json .dumps (item ['doc' ], default = self . _json_serializer )
204
204
rv = meta + '\n ' + body
205
205
elif item ['action' ] == 'update' :
206
- body = ujson .dumps ({'doc' : item ['doc' ]})
206
+ body = json .dumps ({'doc' : item ['doc' ]}, default = self . _json_serializer )
207
207
rv = meta + '\n ' + body
208
208
elif item ['action' ] == 'delete' :
209
209
rv = meta + '\n '
210
210
elif item ['action' ] == 'create' :
211
- body = ujson .dumps (item ['doc' ])
211
+ body = json .dumps (item ['doc' ], default = self . _json_serializer )
212
212
rv = meta + '\n ' + body
213
213
else :
214
214
logging .error ('unknown action type in doc' )
@@ -322,9 +322,9 @@ def _parse_table_structure(self, data):
322
322
serializer = float
323
323
elif 'datetime' in type :
324
324
if '(' in type :
325
- serializer = lambda x : datetime .datetime .strptime (x , '%Y-%m-%d %H:%M:%S.%f' ). isoformat ()
325
+ serializer = lambda x : datetime .datetime .strptime (x , '%Y-%m-%d %H:%M:%S.%f' )
326
326
else :
327
- serializer = lambda x : datetime .datetime .strptime (x , '%Y-%m-%d %H:%M:%S' ). isoformat ()
327
+ serializer = lambda x : datetime .datetime .strptime (x , '%Y-%m-%d %H:%M:%S' )
328
328
elif 'char' in type :
329
329
serializer = str
330
330
elif 'text' in type :
0 commit comments