@@ -172,7 +172,7 @@ def list_symbols(self, all_symbols=False, snapshot=None, regex=None, **kwargs):
172
172
return sorted ([x ['symbol' ] for x in results ])
173
173
174
174
@mongo_retry
175
- def has_symbol (self , symbol , as_of = None , allow_secondary = None ):
175
+ def has_symbol (self , symbol , as_of = None ):
176
176
"""
177
177
Return True if the 'symbol' exists in this library AND the symbol
178
178
isn't deleted in the specified as_of.
@@ -188,14 +188,10 @@ def has_symbol(self, symbol, as_of=None, allow_secondary=None):
188
188
`int` : specific version number
189
189
`str` : snapshot name which contains the version
190
190
`datetime.datetime` : the version of the data that existed as_of the requested point in time
191
- allow_secondary : `bool` or `None`
192
- Override the default behavior for allowing reads from secondary members of a cluster:
193
- `None` : use the settings from the top-level `Arctic` object used to query this version store.
194
- `True` : allow reads from secondary members
195
- `False` : only allow reads from primary members
196
191
"""
197
192
try :
198
- self ._read_metadata (symbol , as_of = as_of , read_preference = self ._read_preference (allow_secondary ))
193
+ # Always use the primary for has_symbol, it's safer
194
+ self ._read_metadata (symbol , as_of = as_of , read_preference = ReadPreference .PRIMARY )
199
195
return True
200
196
except NoDataFoundException :
201
197
return False
@@ -667,7 +663,7 @@ def delete(self, symbol):
667
663
'metadata.deleted' : {'$ne' : True }})
668
664
if not snapped_version :
669
665
self ._delete_version (symbol , sentinel .version )
670
- assert not self .has_symbol (symbol , allow_secondary = False )
666
+ assert not self .has_symbol (symbol )
671
667
672
668
def _write_audit (self , user , message , changed_version ):
673
669
"""
0 commit comments