Skip to content

PYTHON-3162 Deprecate ServerDescription.election_tuple #1189

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

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pymongo/server_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Represent one server the driver is connected to."""

import time
import warnings
from typing import Any, Dict, Mapping, Optional, Set, Tuple

from bson import EPOCH_NAIVE
Expand Down Expand Up @@ -180,6 +181,11 @@ def cluster_time(self) -> Optional[Mapping[str, Any]]:

@property
def election_tuple(self) -> Tuple[Optional[int], Optional[ObjectId]]:
warnings.warn(
"'election_tuple' is deprecated, use 'set_version' and 'election_id' instead",
DeprecationWarning,
stacklevel=2,
)
return self._set_version, self._election_id

@property
Expand Down