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):
5555
5656 Returns
5757 -------
58- index: dict
59- Dictionary containing index information .
58+ index : Index
59+ An Index instance of the newly updated index .
6060 """
6161 payload = {}
6262 primary_key = body .get ('primaryKey' , None )
6363 if primary_key is not None :
6464 payload ['primaryKey' ] = primary_key
6565 response = self .http .put ('{}/{}' .format (self .config .paths .index , self .uid ), payload )
6666 self .primary_key = response ['primaryKey' ]
67- return response
67+ return self
6868
6969 def fetch_info (self ):
7070 """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):
140140 index = self .client .index (uid = self .index_uid )
141141 response = index .update (primaryKey = 'objectID' )
142142 assert isinstance (response , object )
143+ assert response .uid == index .uid
144+ assert response .primary_key == index .primary_key
143145 assert index .primary_key == 'objectID'
144146 assert index .get_primary_key () == 'objectID'
145147
You can’t perform that action at this time.
0 commit comments