Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-4480 Deprecate create=True for Collection #1659

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

NoahStapp
Copy link
Contributor

No description provided.

@@ -197,12 +197,6 @@ def test_create(self):
lambda: "create_test_no_wc" in db.list_collection_names(),
"create create_test_no_wc collection",
)
db.create_test_no_wc.drop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this and catch the warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, when we deprecate something we keep the tests and also add an extra assertion to ensure the warning is actually raised.

@@ -248,6 +249,11 @@ def __init__(

if create or kwargs:
if _IS_SYNC:
warnings.warn(
"The `create` and `kwargs` arguments are deprecated and will be removed in PyMongo 5.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "arguments to Collection are..."

@@ -197,12 +197,6 @@ def test_create(self):
lambda: "create_test_no_wc" in db.list_collection_names(),
"create create_test_no_wc collection",
)
db.create_test_no_wc.drop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, when we deprecate something we keep the tests and also add an extra assertion to ensure the warning is actually raised.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NoahStapp NoahStapp merged commit f7d2deb into mongodb:master Jun 10, 2024
31 of 33 checks passed
@NoahStapp NoahStapp deleted the PYTHON-4480 branch June 10, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants