Skip to content

Commit 058fb5d

Browse files
authored
Rename Python SDK interfaces (#8935)
lgtm
1 parent 9a9b2e6 commit 058fb5d

File tree

2 files changed

+22
-22
lines changed
  • ydb/docs

2 files changed

+22
-22
lines changed

ydb/docs/en/core/dev/example-app/python/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ App code snippet for session pool initialization:
7575
- Asynchronous
7676

7777
```python
78-
async with ydb.aio.QuerySessionPoolAsync(driver) as pool:
78+
async with ydb.aio.QuerySessionPool(driver) as pool:
7979
pass # operations with pool here
8080
```
8181

@@ -155,7 +155,7 @@ To execute `CREATE TABLE` queries, use the `pool.execute_with_retries()` method:
155155
- Asynchronous
156156

157157
```python
158-
async def create_tables(pool: ydb.aio.QuerySessionPoolAsync):
158+
async def create_tables(pool: ydb.aio.QuerySessionPool):
159159
print("\nCreating table series...")
160160
await pool.execute_with_retries(
161161
"""
@@ -221,7 +221,7 @@ Code snippet for data insert/update:
221221
- Asynchronous
222222

223223
```python
224-
async def upsert_simple(pool: ydb.aio.QuerySessionPoolAsync):
224+
async def upsert_simple(pool: ydb.aio.QuerySessionPool):
225225
print("\nPerforming UPSERT into episodes...")
226226
await pool.execute_with_retries(
227227
"""
@@ -269,7 +269,7 @@ To execute YQL queries, the `pool.execute_with_retries()` method is often suffic
269269
- Asynchronous
270270

271271
```python
272-
async def select_simple(pool: ydb.aio.QuerySessionPoolAsync):
272+
async def select_simple(pool: ydb.aio.QuerySessionPool):
273273
print("\nCheck series table...")
274274
result_sets = await pool.execute_with_retries(
275275
"""
@@ -367,7 +367,7 @@ A code snippet demonstrating the parameterized query execution:
367367
- Asynchronous
368368

369369
```python
370-
async def select_with_parameters(pool: ydb.aio.QuerySessionPoolAsync, series_id, season_id, episode_id):
370+
async def select_with_parameters(pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id):
371371
result_sets = await pool.execute_with_retries(
372372
"""
373373
DECLARE $seriesId AS Int64;
@@ -444,7 +444,7 @@ The code snippet below demonstrates the explicit use of `transaction().begin()`
444444

445445
```python
446446
def explicit_transaction_control(pool: ydb.QuerySessionPool, series_id, season_id, episode_id):
447-
def callee(session: ydb.QuerySessionSync):
447+
def callee(session: ydb.QuerySession):
448448
query = """
449449
DECLARE $seriesId AS Int64;
450450
DECLARE $seasonId AS Int64;
@@ -482,9 +482,9 @@ The code snippet below demonstrates the explicit use of `transaction().begin()`
482482

483483
```python
484484
async def explicit_transaction_control(
485-
pool: ydb.aio.QuerySessionPoolAsync, series_id, season_id, episode_id
485+
pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id
486486
):
487-
async def callee(session: ydb.aio.QuerySessionAsync):
487+
async def callee(session: ydb.aio.QuerySession):
488488
query = """
489489
DECLARE $seriesId AS Int64;
490490
DECLARE $seasonId AS Int64;
@@ -534,7 +534,7 @@ Example of a `SELECT` with unlimited data and implicit transaction control:
534534

535535
```python
536536
def huge_select(pool: ydb.QuerySessionPool):
537-
def callee(session: ydb.QuerySessionSync):
537+
def callee(session: ydb.QuerySession):
538538
query = """SELECT * from episodes;"""
539539

540540
with session.transaction(ydb.QuerySnapshotReadOnly()).execute(
@@ -552,8 +552,8 @@ Example of a `SELECT` with unlimited data and implicit transaction control:
552552
- Asynchronous
553553

554554
```python
555-
async def huge_select(pool: ydb.aio.QuerySessionPoolAsync):
556-
async def callee(session: ydb.aio.QuerySessionAsync):
555+
async def huge_select(pool: ydb.aio.QuerySessionPool):
556+
async def callee(session: ydb.aio.QuerySession):
557557
query = """SELECT * from episodes;"""
558558

559559
async with await session.transaction(ydb.QuerySnapshotReadOnly()).execute(

ydb/docs/ru/core/dev/example-app/python/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ python3 -m pip install iso8601
7575
- Асинхронный
7676

7777
```python
78-
async with ydb.aio.QuerySessionPoolAsync(driver) as pool:
78+
async with ydb.aio.QuerySessionPool(driver) as pool:
7979
pass # operations with pool here
8080
```
8181

@@ -153,7 +153,7 @@ python3 -m pip install iso8601
153153
- Асинхронный
154154

155155
```python
156-
async def create_tables(pool: ydb.aio.QuerySessionPoolAsync):
156+
async def create_tables(pool: ydb.aio.QuerySessionPool):
157157
print("\nCreating table series...")
158158
await pool.execute_with_retries(
159159
"""
@@ -219,7 +219,7 @@ python3 -m pip install iso8601
219219
- Асинхронный
220220

221221
```python
222-
async def upsert_simple(pool: ydb.aio.QuerySessionPoolAsync):
222+
async def upsert_simple(pool: ydb.aio.QuerySessionPool):
223223
print("\nPerforming UPSERT into episodes...")
224224
await pool.execute_with_retries(
225225
"""
@@ -267,7 +267,7 @@ python3 -m pip install iso8601
267267
- Асинхронный
268268

269269
```python
270-
async def select_simple(pool: ydb.aio.QuerySessionPoolAsync):
270+
async def select_simple(pool: ydb.aio.QuerySessionPool):
271271
print("\nCheck series table...")
272272
result_sets = await pool.execute_with_retries(
273273
"""
@@ -365,7 +365,7 @@ series, Id: 1, title: IT Crowd, Release date: 2006-02-03
365365
- Асинхронный
366366

367367
```python
368-
async def select_with_parameters(pool: ydb.aio.QuerySessionPoolAsync, series_id, season_id, episode_id):
368+
async def select_with_parameters(pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id):
369369
result_sets = await pool.execute_with_retries(
370370
"""
371371
DECLARE $seriesId AS Int64;
@@ -443,7 +443,7 @@ series, Id: 1, title: IT Crowd, Release date: 2006-02-03
443443

444444
```python
445445
def explicit_transaction_control(pool: ydb.QuerySessionPool, series_id, season_id, episode_id):
446-
def callee(session: ydb.QuerySessionSync):
446+
def callee(session: ydb.QuerySession):
447447
query = """
448448
DECLARE $seriesId AS Int64;
449449
DECLARE $seasonId AS Int64;
@@ -481,9 +481,9 @@ series, Id: 1, title: IT Crowd, Release date: 2006-02-03
481481

482482
```python
483483
async def explicit_transaction_control(
484-
pool: ydb.aio.QuerySessionPoolAsync, series_id, season_id, episode_id
484+
pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id
485485
):
486-
async def callee(session: ydb.aio.QuerySessionAsync):
486+
async def callee(session: ydb.aio.QuerySession):
487487
query = """
488488
DECLARE $seriesId AS Int64;
489489
DECLARE $seasonId AS Int64;
@@ -534,7 +534,7 @@ series, Id: 1, title: IT Crowd, Release date: 2006-02-03
534534

535535
```python
536536
def huge_select(pool: ydb.QuerySessionPool):
537-
def callee(session: ydb.QuerySessionSync):
537+
def callee(session: ydb.QuerySession):
538538
query = """SELECT * from episodes;"""
539539

540540
with session.transaction(ydb.QuerySnapshotReadOnly()).execute(
@@ -552,8 +552,8 @@ series, Id: 1, title: IT Crowd, Release date: 2006-02-03
552552
- Асинхронный
553553

554554
```python
555-
async def huge_select(pool: ydb.aio.QuerySessionPoolAsync):
556-
async def callee(session: ydb.aio.QuerySessionAsync):
555+
async def huge_select(pool: ydb.aio.QuerySessionPool):
556+
async def callee(session: ydb.aio.QuerySession):
557557
query = """SELECT * from episodes;"""
558558

559559
async with await session.transaction(ydb.QuerySnapshotReadOnly()).execute(

0 commit comments

Comments
 (0)