Skip to content

Commit efd833b

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents fa821ac + 8c361be commit efd833b

File tree

11 files changed

+38
-38
lines changed

11 files changed

+38
-38
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
build-mode: none
3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
4242
with:
4343
ref: ${{ inputs.ref }}
4444
persist-credentials: false
4545
- uses: actions/setup-python@v5
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3
49+
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3
5050
with:
5151
languages: ${{ matrix.language }}
5252
build-mode: ${{ matrix.build-mode }}
@@ -63,6 +63,6 @@ jobs:
6363
pip install -e .
6464
6565
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3
66+
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3
6767
with:
6868
category: "/language:${{matrix.language}}"

.github/workflows/dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
steps:
4747
- name: Checkout pymongo
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@v5
4949
with:
5050
fetch-depth: 0
5151
persist-credentials: false
@@ -108,7 +108,7 @@ jobs:
108108
name: Make SDist
109109
runs-on: macos-13
110110
steps:
111-
- uses: actions/checkout@v4
111+
- uses: actions/checkout@v5
112112
with:
113113
fetch-depth: 0
114114
persist-credentials: false

.github/workflows/test-python.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
static:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
with:
2424
persist-credentials: false
2525
- name: Install uv
26-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
26+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
2727
with:
2828
enable-cache: true
2929
python-version: "3.9"
@@ -61,11 +61,11 @@ jobs:
6161

6262
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
6363
steps:
64-
- uses: actions/checkout@v4
64+
- uses: actions/checkout@v5
6565
with:
6666
persist-credentials: false
6767
- name: Install uv
68-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
68+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
6969
with:
7070
enable-cache: true
7171
python-version: ${{ matrix.python-version }}
@@ -80,11 +80,11 @@ jobs:
8080
runs-on: ubuntu-latest
8181
name: DocTest
8282
steps:
83-
- uses: actions/checkout@v4
83+
- uses: actions/checkout@v5
8484
with:
8585
persist-credentials: false
8686
- name: Install uv
87-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
87+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
8888
with:
8989
enable-cache: true
9090
python-version: "3.9"
@@ -105,11 +105,11 @@ jobs:
105105
name: Docs Checks
106106
runs-on: ubuntu-latest
107107
steps:
108-
- uses: actions/checkout@v4
108+
- uses: actions/checkout@v5
109109
with:
110110
persist-credentials: false
111111
- name: Install uv
112-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
112+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
113113
with:
114114
enable-cache: true
115115
python-version: "3.9"
@@ -124,11 +124,11 @@ jobs:
124124
name: Link Check
125125
runs-on: ubuntu-latest
126126
steps:
127-
- uses: actions/checkout@v4
127+
- uses: actions/checkout@v5
128128
with:
129129
persist-credentials: false
130130
- name: Install uv
131-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
131+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
132132
with:
133133
enable-cache: true
134134
python-version: "3.9"
@@ -146,11 +146,11 @@ jobs:
146146
matrix:
147147
python: ["3.9", "3.11"]
148148
steps:
149-
- uses: actions/checkout@v4
149+
- uses: actions/checkout@v5
150150
with:
151151
persist-credentials: false
152152
- name: Install uv
153-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
153+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
154154
with:
155155
enable-cache: true
156156
python-version: "${{matrix.python}}"
@@ -167,7 +167,7 @@ jobs:
167167
runs-on: ubuntu-latest
168168
name: "Make an sdist"
169169
steps:
170-
- uses: actions/checkout@v4
170+
- uses: actions/checkout@v5
171171
with:
172172
persist-credentials: false
173173
- uses: actions/setup-python@v5
@@ -225,11 +225,11 @@ jobs:
225225
runs-on: ubuntu-latest
226226
name: Test using minimum dependencies and supported Python
227227
steps:
228-
- uses: actions/checkout@v4
228+
- uses: actions/checkout@v5
229229
with:
230230
persist-credentials: false
231231
- name: Install uv
232-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
232+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
233233
with:
234234
python-version: '3.9'
235235
- id: setup-mongodb
@@ -251,11 +251,11 @@ jobs:
251251
runs-on: ubuntu-latest
252252
name: Test async's minimum dependencies and Python
253253
steps:
254-
- uses: actions/checkout@v4
254+
- uses: actions/checkout@v5
255255
with:
256256
persist-credentials: false
257257
- name: Install uv
258-
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v5
258+
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v5
259259
with:
260260
python-version: '3.9'
261261
- id: setup-mongodb

.github/workflows/zizmor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
security-events: write
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818
with:
1919
persist-credentials: false
2020
- name: Run zizmor 🌈
21-
uses: zizmorcore/zizmor-action@383d31df2eb66a2f42db98c9654bdc73231f3e3a
21+
uses: zizmorcore/zizmor-action@7f2abfff7488a44086dba64ed2f5a9b431508079

pymongo/asynchronous/client_session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
WTimeoutError,
168168
)
169169
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
170-
from pymongo.operations import _Op
171170
from pymongo.read_concern import ReadConcern
172171
from pymongo.read_preferences import ReadPreference, _ServerMode
173172
from pymongo.server_type import SERVER_TYPE
@@ -868,7 +867,7 @@ async def func(
868867
return await self._finish_transaction(conn, command_name)
869868

870869
return await self._client._retry_internal(
871-
func, self, None, retryable=True, operation=_Op.ABORT
870+
func, self, None, retryable=True, operation=command_name
872871
)
873872

874873
async def _finish_transaction(self, conn: AsyncConnection, command_name: str) -> dict[str, Any]:

pymongo/synchronous/client_session.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@
165165
WTimeoutError,
166166
)
167167
from pymongo.helpers_shared import _RETRYABLE_ERROR_CODES
168-
from pymongo.operations import _Op
169168
from pymongo.read_concern import ReadConcern
170169
from pymongo.read_preferences import ReadPreference, _ServerMode
171170
from pymongo.server_type import SERVER_TYPE
@@ -864,7 +863,9 @@ def func(
864863
) -> dict[str, Any]:
865864
return self._finish_transaction(conn, command_name)
866865

867-
return self._client._retry_internal(func, self, None, retryable=True, operation=_Op.ABORT)
866+
return self._client._retry_internal(
867+
func, self, None, retryable=True, operation=command_name
868+
)
868869

869870
def _finish_transaction(self, conn: Connection, command_name: str) -> dict[str, Any]:
870871
self._transaction.attempt += 1

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ gevent = ["gevent", "cffi>=2.0.0b1;python_version=='3.14'"]
5555
eventlet = ["eventlet"]
5656
coverage = [
5757
"pytest-cov",
58-
"coverage>=5,<=7.10.3"
58+
"coverage>=5,<=7.10.5"
5959
]
6060
mockupdb = [
6161
"mockupdb@git+https://github.com/mongodb-labs/mongo-mockup-db@master"
@@ -66,7 +66,7 @@ pymongocrypt_source = [
6666
perf = ["simplejson"]
6767
typing = [
6868
"mypy==1.17.1",
69-
"pyright==1.1.403",
69+
"pyright==1.1.404",
7070
"typing_extensions",
7171
"pip"
7272
]

test/asynchronous/test_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ async def test_error_code(self):
13191319
self.assertIn(exc.code, (9, 10147, 16840, 17009))
13201320
# Just check that we set the error document. Fields
13211321
# vary by MongoDB version.
1322-
self.assertTrue(exc.details is not None)
1322+
self.assertIsNotNone(exc.details)
13231323
else:
13241324
self.fail("OperationFailure was not raised")
13251325

test/asynchronous/test_session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ async def test_cursor_clone(self):
378378

379379
async with self.client.start_session() as s:
380380
cursor = coll.find(session=s)
381-
self.assertTrue(cursor.session is s)
381+
self.assertIs(cursor.session, s)
382382
clone = cursor.clone()
383-
self.assertTrue(clone.session is s)
383+
self.assertIs(clone.session, s)
384384

385385
# No explicit session.
386386
cursor = coll.find(batch_size=2)
@@ -392,7 +392,7 @@ async def test_cursor_clone(self):
392392
await anext(clone)
393393
self.assertIsNone(clone.session)
394394
self.assertIsNotNone(clone._session)
395-
self.assertFalse(cursor._session is clone._session)
395+
self.assertIsNot(cursor._session, clone._session)
396396
await cursor.close()
397397
await clone.close()
398398

test/test_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ def test_error_code(self):
13051305
self.assertIn(exc.code, (9, 10147, 16840, 17009))
13061306
# Just check that we set the error document. Fields
13071307
# vary by MongoDB version.
1308-
self.assertTrue(exc.details is not None)
1308+
self.assertIsNotNone(exc.details)
13091309
else:
13101310
self.fail("OperationFailure was not raised")
13111311

0 commit comments

Comments
 (0)