From 4ee11d35c5643db6fc8573a22dcd12f518dc43c0 Mon Sep 17 00:00:00 2001 From: "Lewis M. Kabui" <13940255+lewisemm@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:09:41 +0300 Subject: [PATCH] chore: Use preferred collection method `delete_one` (#34214) `remove` method of Collection objects has been deprecated in favour of either `delete_one` or `delete_many`. This change will address 36 deprecation warnings that are generated from test runs. Co-authored-by: Lewis Kabui --- xmodule/modulestore/split_mongo/mongo_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmodule/modulestore/split_mongo/mongo_connection.py b/xmodule/modulestore/split_mongo/mongo_connection.py index 33f09352b958..277aff28d4d7 100644 --- a/xmodule/modulestore/split_mongo/mongo_connection.py +++ b/xmodule/modulestore/split_mongo/mongo_connection.py @@ -506,7 +506,7 @@ def delete_course_index(self, course_key): key_attr: getattr(course_key, key_attr) for key_attr in ('org', 'course', 'run') } - return self.course_index.remove(query) + return self.course_index.delete_one(query) def get_definition(self, key, course_context=None): """