|
64 | 64 | class SearchCommands: |
65 | 65 | """Search commands.""" |
66 | 66 |
|
67 | | - @property |
68 | | - def index_name(self) -> str: |
69 | | - """The name of the search index. Must be implemented by inheriting classes.""" |
70 | | - if not hasattr(self, "_index_name"): |
71 | | - raise AttributeError("index_name must be set by the inheriting class") |
72 | | - return self._index_name |
73 | | - |
74 | | - @index_name.setter |
75 | | - def index_name(self, value: str) -> None: |
76 | | - """Set the name of the search index.""" |
77 | | - self._index_name = value |
78 | | - |
79 | | - @property |
80 | | - def client(self): |
81 | | - """The Redis client. Must be provided by inheriting classes.""" |
82 | | - if not hasattr(self, "_client"): |
83 | | - raise AttributeError("client must be set by the inheriting class") |
84 | | - return self._client |
85 | | - |
86 | | - @client.setter |
87 | | - def client(self, value) -> None: |
88 | | - """Set the Redis client.""" |
89 | | - self._client = value |
90 | | - |
91 | | - @property |
92 | | - def _RESP2_MODULE_CALLBACKS(self): |
93 | | - """Response callbacks for RESP2. Must be provided by inheriting classes.""" |
94 | | - if not hasattr(self, "_resp2_module_callbacks"): |
95 | | - raise AttributeError( |
96 | | - "_RESP2_MODULE_CALLBACKS must be set by the inheriting class" |
97 | | - ) |
98 | | - return self._resp2_module_callbacks |
99 | | - |
100 | | - @_RESP2_MODULE_CALLBACKS.setter |
101 | | - def _RESP2_MODULE_CALLBACKS(self, value) -> None: |
102 | | - """Set the RESP2 module callbacks.""" |
103 | | - self._resp2_module_callbacks = value |
104 | | - |
105 | 67 | def _parse_results(self, cmd, res, **kwargs): |
106 | 68 | if get_protocol_version(self.client) in ["3", 3]: |
107 | 69 | return ProfileInformation(res) if cmd == "FT.PROFILE" else res |
|
0 commit comments