Skip to content
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

Rename Python SDK interfaces #8935

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions ydb/docs/en/core/dev/example-app/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ App code snippet for session pool initialization:
- Asynchronous

```python
async with ydb.aio.QuerySessionPoolAsync(driver) as pool:
async with ydb.aio.QuerySessionPool(driver) as pool:
pass # operations with pool here
```

Expand Down Expand Up @@ -153,7 +153,7 @@ To execute `CREATE TABLE` queries, use the `pool.execute_with_retries()` method:
- Asynchronous

```python
async def create_tables(pool: ydb.aio.QuerySessionPoolAsync):
async def create_tables(pool: ydb.aio.QuerySessionPool):
print("\nCreating table series...")
await pool.execute_with_retries(
"""
Expand Down Expand Up @@ -219,7 +219,7 @@ Code snippet for data insert/update:
- Asynchronous

```python
async def upsert_simple(pool: ydb.aio.QuerySessionPoolAsync):
async def upsert_simple(pool: ydb.aio.QuerySessionPool):
print("\nPerforming UPSERT into episodes...")
await pool.execute_with_retries(
"""
Expand Down Expand Up @@ -267,7 +267,7 @@ To execute YQL queries, the `pool.execute_with_retries()` method is often suffic
- Asynchronous

```python
async def select_simple(pool: ydb.aio.QuerySessionPoolAsync):
async def select_simple(pool: ydb.aio.QuerySessionPool):
print("\nCheck series table...")
result_sets = await pool.execute_with_retries(
"""
Expand Down Expand Up @@ -365,7 +365,7 @@ A code snippet demonstrating the parameterized query execution:
- Asynchronous

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

```python
def explicit_transaction_control(pool: ydb.QuerySessionPool, series_id, season_id, episode_id):
def callee(session: ydb.QuerySessionSync):
def callee(session: ydb.QuerySession):
query = """
DECLARE $seriesId AS Int64;
DECLARE $seasonId AS Int64;
Expand Down Expand Up @@ -480,9 +480,9 @@ The code snippet below demonstrates the explicit use of `transaction().begin()`

```python
async def explicit_transaction_control(
pool: ydb.aio.QuerySessionPoolAsync, series_id, season_id, episode_id
pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id
):
async def callee(session: ydb.aio.QuerySessionAsync):
async def callee(session: ydb.aio.QuerySession):
query = """
DECLARE $seriesId AS Int64;
DECLARE $seasonId AS Int64;
Expand Down Expand Up @@ -532,7 +532,7 @@ Example of a `SELECT` with unlimited data and implicit transaction control:

```python
def huge_select(pool: ydb.QuerySessionPool):
def callee(session: ydb.QuerySessionSync):
def callee(session: ydb.QuerySession):
query = """SELECT * from episodes;"""

with session.transaction(ydb.QuerySnapshotReadOnly()).execute(
Expand All @@ -550,8 +550,8 @@ Example of a `SELECT` with unlimited data and implicit transaction control:
- Asynchronous

```python
async def huge_select(pool: ydb.aio.QuerySessionPoolAsync):
async def callee(session: ydb.aio.QuerySessionAsync):
async def huge_select(pool: ydb.aio.QuerySessionPool):
async def callee(session: ydb.aio.QuerySession):
query = """SELECT * from episodes;"""

async with await session.transaction(ydb.QuerySnapshotReadOnly()).execute(
Expand Down
22 changes: 11 additions & 11 deletions ydb/docs/ru/core/dev/example-app/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python3 -m pip install iso8601
- Асинхронный

```python
async with ydb.aio.QuerySessionPoolAsync(driver) as pool:
async with ydb.aio.QuerySessionPool(driver) as pool:
pass # operations with pool here
```

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

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

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

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

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

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

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

```python
def huge_select(pool: ydb.QuerySessionPool):
def callee(session: ydb.QuerySessionSync):
def callee(session: ydb.QuerySession):
query = """SELECT * from episodes;"""

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

```python
async def huge_select(pool: ydb.aio.QuerySessionPoolAsync):
async def callee(session: ydb.aio.QuerySessionAsync):
async def huge_select(pool: ydb.aio.QuerySessionPool):
async def callee(session: ydb.aio.QuerySession):
query = """SELECT * from episodes;"""

async with await session.transaction(ydb.QuerySnapshotReadOnly()).execute(
Expand Down
Loading