File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -55,16 +55,16 @@ def update(self, **body):
55
55
56
56
Returns
57
57
-------
58
- index: dict
59
- Dictionary containing index information .
58
+ index : Index
59
+ An Index instance of the newly updated index .
60
60
"""
61
61
payload = {}
62
62
primary_key = body .get ('primaryKey' , None )
63
63
if primary_key is not None :
64
64
payload ['primaryKey' ] = primary_key
65
65
response = self .http .put ('{}/{}' .format (self .config .paths .index , self .uid ), payload )
66
66
self .primary_key = response ['primaryKey' ]
67
- return response
67
+ return self
68
68
69
69
def fetch_info (self ):
70
70
"""Fetch the info of the index.
Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ def test_update_index(self):
140
140
index = self .client .index (uid = self .index_uid )
141
141
response = index .update (primaryKey = 'objectID' )
142
142
assert isinstance (response , object )
143
+ assert response .uid == index .uid
144
+ assert response .primary_key == index .primary_key
143
145
assert index .primary_key == 'objectID'
144
146
assert index .get_primary_key () == 'objectID'
145
147
You can’t perform that action at this time.
0 commit comments