Skip to content

Commit b38a416

Browse files
authored
PYTHON-3162 Deprecate ServerDescription.election_tuple (#1189)
1 parent f7225fd commit b38a416

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pymongo/server_description.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""Represent one server the driver is connected to."""
1616

1717
import time
18+
import warnings
1819
from typing import Any, Dict, Mapping, Optional, Set, Tuple
1920

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

181182
@property
182183
def election_tuple(self) -> Tuple[Optional[int], Optional[ObjectId]]:
184+
warnings.warn(
185+
"'election_tuple' is deprecated, use 'set_version' and 'election_id' instead",
186+
DeprecationWarning,
187+
stacklevel=2,
188+
)
183189
return self._set_version, self._election_id
184190

185191
@property

0 commit comments

Comments
 (0)