You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseTypeError(f"hedge must be a dictionary, not {hedge!r}")
105
106
107
+
warnings.warn(
108
+
"The read preference 'hedge' option is deprecated in PyMongo 4.12+ because hedged reads are deprecated in MongoDB version 8.0+. Support for 'hedge' will be removed in PyMongo 5.0.",
"""**DEPRECATED** - The read preference 'hedge' option is deprecated in PyMongo 4.12+ because hedged reads are deprecated in MongoDB version 8.0+. Support for 'hedge' will be removed in PyMongo 5.0.
193
+
194
+
The read preference ``hedge`` parameter.
187
195
188
196
A dictionary that configures how the server will perform hedged reads.
"The read preference 'hedge' option is deprecated in PyMongo 4.12+ because hedged reads are deprecated in MongoDB version 8.0+. Support for 'hedge' will be removed in PyMongo 5.0.",
217
+
DeprecationWarning,
218
+
stacklevel=2,
219
+
)
206
220
returnself.__hedge
207
221
208
222
@property
@@ -312,7 +326,7 @@ class PrimaryPreferred(_ServerMode):
312
326
replication before it will no longer be selected for operations.
313
327
Default -1, meaning no maximum. If it is set, it must be at least
314
328
90 seconds.
315
-
:param hedge: The :attr:`~hedge` to use if the primary is not available.
329
+
:param hedge: **DEPRECATED** - The :attr:`~hedge` for this read preference.
316
330
317
331
.. versionchanged:: 3.11
318
332
Added ``hedge`` parameter.
@@ -354,7 +368,7 @@ class Secondary(_ServerMode):
354
368
replication before it will no longer be selected for operations.
355
369
Default -1, meaning no maximum. If it is set, it must be at least
356
370
90 seconds.
357
-
:param hedge: The :attr:`~hedge` for this read preference.
371
+
:param hedge: **DEPRECATED** - The :attr:`~hedge` for this read preference.
358
372
359
373
.. versionchanged:: 3.11
360
374
Added ``hedge`` parameter.
@@ -397,7 +411,7 @@ class SecondaryPreferred(_ServerMode):
397
411
replication before it will no longer be selected for operations.
398
412
Default -1, meaning no maximum. If it is set, it must be at least
399
413
90 seconds.
400
-
:param hedge: The :attr:`~hedge` for this read preference.
414
+
:param hedge: **DEPRECATED** - The :attr:`~hedge` for this read preference.
401
415
402
416
.. versionchanged:: 3.11
403
417
Added ``hedge`` parameter.
@@ -441,7 +455,7 @@ class Nearest(_ServerMode):
441
455
replication before it will no longer be selected for operations.
442
456
Default -1, meaning no maximum. If it is set, it must be at least
443
457
90 seconds.
444
-
:param hedge: The :attr:`~hedge` for this read preference.
458
+
:param hedge: **DEPRECATED** - The :attr:`~hedge` for this read preference.
0 commit comments