@@ -851,30 +851,21 @@ def create_index(cls, keys, background=False, **kwargs):
851851 index_spec = cls ._build_index_spec (keys )
852852 index_spec = index_spec .copy ()
853853 fields = index_spec .pop ("fields" )
854- drop_dups = kwargs .get ("drop_dups" , False )
855- if drop_dups :
856- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
857- warnings .warn (msg , DeprecationWarning )
858854 index_spec ["background" ] = background
859855 index_spec .update (kwargs )
860856
861857 return cls ._get_collection ().create_index (fields , ** index_spec )
862858
863859 @classmethod
864- def ensure_index (cls , key_or_list , drop_dups = False , background = False , ** kwargs ):
860+ def ensure_index (cls , key_or_list , background = False , ** kwargs ):
865861 """Ensure that the given indexes are in place. Deprecated in favour
866862 of create_index.
867863
868864 :param key_or_list: a single index key or a list of index keys (to
869865 construct a multi-field index); keys may be prefixed with a **+**
870866 or a **-** to determine the index ordering
871867 :param background: Allows index creation in the background
872- :param drop_dups: Was removed/ignored with MongoDB >2.7.5. The value
873- will be removed if PyMongo3+ is used
874868 """
875- if drop_dups :
876- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
877- warnings .warn (msg , DeprecationWarning )
878869 return cls .create_index (key_or_list , background = background , ** kwargs )
879870
880871 @classmethod
@@ -887,12 +878,8 @@ def ensure_indexes(cls):
887878 `auto_create_index` to False in the documents meta data
888879 """
889880 background = cls ._meta .get ("index_background" , False )
890- drop_dups = cls ._meta .get ("index_drop_dups" , False )
891881 index_opts = cls ._meta .get ("index_opts" ) or {}
892882 index_cls = cls ._meta .get ("index_cls" , True )
893- if drop_dups :
894- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
895- warnings .warn (msg , DeprecationWarning )
896883
897884 collection = cls ._get_collection ()
898885 # 746: when connection is via mongos, the read preference is not necessarily an indication that
0 commit comments