MCPcopy
hub / github.com/redis/redis-py / _parse_results

Method _parse_results

redis/commands/search/commands.py:173–194  ·  view source on GitHub ↗
(self, cmd, res, **kwargs)

Source from the content-addressed store, hash-verified

171 )
172
173 def _parse_results(self, cmd, res, **kwargs):
174 if cmd in self._QUERY_REQUIRED_CMDS and "query" not in kwargs:
175 return res
176 protocol = get_protocol_version(self.client)
177 legacy = get_legacy_responses(self.client)
178 if legacy:
179 if protocol in (3, "3"):
180 if cmd == PROFILE_CMD:
181 return ProfileInformation(res)
182 cb = self._RESP3_MODULE_CALLBACKS.get(cmd)
183 elif check_protocol_version(protocol, 3):
184 cb = self._RESP3_TO_RESP2_LEGACY_MODULE_CALLBACKS.get(cmd)
185 else:
186 cb = self._RESP2_MODULE_CALLBACKS.get(cmd)
187 else:
188 if check_protocol_version(protocol, 3):
189 cb = self._RESP3_UNIFIED_MODULE_CALLBACKS.get(cmd)
190 else:
191 cb = self._RESP2_UNIFIED_MODULE_CALLBACKS.get(cmd)
192 if cb is None:
193 return res
194 return cb(res, **kwargs)
195
196 @staticmethod
197 def _resp3_get(mapping, key, default=None):

Callers 14

infoMethod · 0.95
searchMethod · 0.95
hybrid_searchMethod · 0.95
aggregateMethod · 0.95
profileMethod · 0.95
spellcheckMethod · 0.95
config_getMethod · 0.95
syndumpMethod · 0.95
infoMethod · 0.80
searchMethod · 0.80
hybrid_searchMethod · 0.80
aggregateMethod · 0.80

Calls 5

check_protocol_versionFunction · 0.90
ProfileInformationClass · 0.85
get_protocol_versionFunction · 0.50
get_legacy_responsesFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected