You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
176: Restructure code r=curquiza a=curquiza
⚠️ Should be merged after the merge of #175
Breaking change:
- Make the internal method `Index.create(...)` a `@classmethod` instead of a `@staticmethod`. Why? Put the logic related to an index in the `Index` class instead of the `Client` class.
See the difference between static and class methods in Python: https://stackabuse.com/pythons-classmethod-and-staticmethod-explained/.
- Remove the internal method `Index.get_indexes()`. Since it's not related to only one index, this method should not be present in the `Index` class.
- Make the `update()` method returns an `Index` object instead of a `dict` because it's more convenient to manipulate object instead of dict. This is consitent with `client.index('movies').fetch_info()` and `client.create_index('movies)` and `client.index('movies')`
Changes:
- Check the type of the responses more accurately: `assert isinstance(response, Index)`
Co-authored-by: Clementine Urquizar <[email protected]>
0 commit comments