|
1 | 1 | import ast |
2 | 2 | import abc |
3 | 3 | import json |
4 | | -import pickle |
5 | 4 | import msgpack |
6 | 5 | import numpy as np |
7 | 6 |
|
@@ -42,7 +41,6 @@ def should_wrap(): |
42 | 41 | While returning the response the, |
43 | 42 | kwikapi will wrap the response as - |
44 | 43 | {success: value, result: value} |
45 | | -
|
46 | 44 | This method, can used in above situation, |
47 | 45 | if no wrapping is required, |
48 | 46 | override this method in the protocol class. |
@@ -107,32 +105,6 @@ def get_mime_type(): |
107 | 105 | return "application/x-msgpack" |
108 | 106 |
|
109 | 107 |
|
110 | | -class PickleProtocol(BaseProtocol): |
111 | | - @staticmethod |
112 | | - def get_name(): |
113 | | - return "pickle" |
114 | | - |
115 | | - @staticmethod |
116 | | - def serialize(data): |
117 | | - return pickle.dumps(data) |
118 | | - |
119 | | - @staticmethod |
120 | | - def deserialize(data): |
121 | | - return pickle.loads(data) |
122 | | - |
123 | | - @classmethod |
124 | | - def deserialize_stream(cls, data): |
125 | | - raise StreamingNotSupported(cls.get_name()) |
126 | | - |
127 | | - @classmethod |
128 | | - def get_record_separator(cls): |
129 | | - raise StreamingNotSupported(cls.get_name()) |
130 | | - |
131 | | - @staticmethod |
132 | | - def get_mime_type(): |
133 | | - return "application/pickle" |
134 | | - |
135 | | - |
136 | 108 | class RawProtocol(BaseProtocol): |
137 | 109 | @staticmethod |
138 | 110 | def get_name(): |
@@ -227,13 +199,7 @@ def get_mime_type(): |
227 | 199 |
|
228 | 200 | PROTOCOLS = dict( |
229 | 201 | (p.get_name(), p) |
230 | | - for p in [ |
231 | | - JsonProtocol, |
232 | | - MessagePackProtocol, |
233 | | - PickleProtocol, |
234 | | - NumpyProtocol, |
235 | | - RawProtocol, |
236 | | - ] |
| 202 | + for p in [RawProtocol, JsonProtocol, NumpyProtocol, MessagePackProtocol] |
237 | 203 | ) |
238 | 204 |
|
239 | 205 | DEFAULT_PROTOCOL = JsonProtocol.get_name() |
0 commit comments