Skip to content

Commit ce03ac6

Browse files
authored
Merge pull request #488 from ydb-platform/remove_experimental
Remove experimental warn from query service
2 parents 67dfc17 + e1c83d5 commit ce03ac6

File tree

7 files changed

+25
-81
lines changed

7 files changed

+25
-81
lines changed

ydb/aio/query/pool.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def __init__(self, driver: common_utils.SupportedDriverType, size: int = 100):
2828
:param size: Size of session pool
2929
"""
3030

31-
logger.warning("QuerySessionPool is an experimental API, which could be changed.")
3231
self._driver = driver
3332
self._size = size
3433
self._should_stop = asyncio.Event()
@@ -44,9 +43,7 @@ async def _create_new_session(self):
4443
return session
4544

4645
async def acquire(self) -> QuerySession:
47-
"""WARNING: This API is experimental and could be changed.
48-
49-
Acquire a session from Session Pool.
46+
"""Acquire a session from Session Pool.
5047
5148
:return A QuerySession object.
5249
"""
@@ -86,28 +83,20 @@ async def acquire(self) -> QuerySession:
8683
return session
8784

8885
async def release(self, session: QuerySession) -> None:
89-
"""WARNING: This API is experimental and could be changed.
90-
91-
Release a session back to Session Pool.
92-
"""
86+
"""Release a session back to Session Pool."""
9387

9488
self._queue.put_nowait(session)
9589
logger.debug("Session returned to queue: %s", session._state.session_id)
9690

9791
def checkout(self) -> "SimpleQuerySessionCheckoutAsync":
98-
"""WARNING: This API is experimental and could be changed.
99-
100-
Return a Session context manager, that acquires session on enter and releases session on exit.
101-
"""
92+
"""Return a Session context manager, that acquires session on enter and releases session on exit."""
10293

10394
return SimpleQuerySessionCheckoutAsync(self)
10495

10596
async def retry_operation_async(
10697
self, callee: Callable, retry_settings: Optional[RetrySettings] = None, *args, **kwargs
10798
):
108-
"""WARNING: This API is experimental and could be changed.
109-
110-
Special interface to execute a bunch of commands with session in a safe, retriable way.
99+
"""Special interface to execute a bunch of commands with session in a safe, retriable way.
111100
112101
:param callee: A function, that works with session.
113102
:param retry_settings: RetrySettings object.
@@ -131,9 +120,7 @@ async def execute_with_retries(
131120
*args,
132121
**kwargs,
133122
) -> List[convert.ResultSet]:
134-
"""WARNING: This API is experimental and could be changed.
135-
136-
Special interface to execute a one-shot queries in a safe, retriable way.
123+
"""Special interface to execute a one-shot queries in a safe, retriable way.
137124
Note: this method loads all data from stream before return, do not use this
138125
method with huge read queries.
139126

ydb/aio/query/session.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ async def _check_session_status_loop(self) -> None:
6464
self._state._change_state(QuerySessionStateEnum.CLOSED)
6565

6666
async def delete(self, settings: Optional[BaseRequestSettings] = None) -> None:
67-
"""WARNING: This API is experimental and could be changed.
68-
69-
Deletes a Session of Query Service on server side and releases resources.
67+
"""Deletes a Session of Query Service on server side and releases resources.
7068
7169
:return: None
7270
"""
@@ -78,9 +76,7 @@ async def delete(self, settings: Optional[BaseRequestSettings] = None) -> None:
7876
self._stream.cancel()
7977

8078
async def create(self, settings: Optional[BaseRequestSettings] = None) -> "QuerySession":
81-
"""WARNING: This API is experimental and could be changed.
82-
83-
Creates a Session of Query Service on server side and attaches it.
79+
"""Creates a Session of Query Service on server side and attaches it.
8480
8581
:return: QuerySession object.
8682
"""
@@ -113,9 +109,7 @@ async def execute(
113109
concurrent_result_sets: bool = False,
114110
settings: Optional[BaseRequestSettings] = None,
115111
) -> AsyncResponseContextIterator:
116-
"""WARNING: This API is experimental and could be changed.
117-
118-
Sends a query to Query Service
112+
"""Sends a query to Query Service
119113
120114
:param query: (YQL or SQL text) to be executed.
121115
:param syntax: Syntax of the query, which is a one from the following choises:

ydb/aio/query/transaction.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ async def _ensure_prev_stream_finished(self) -> None:
4848
self._prev_stream = None
4949

5050
async def begin(self, settings: Optional[BaseRequestSettings] = None) -> "QueryTxContext":
51-
"""WARNING: This API is experimental and could be changed.
52-
53-
Explicitly begins a transaction
51+
"""Explicitly begins a transaction
5452
5553
:param settings: An additional request settings BaseRequestSettings;
5654
@@ -60,9 +58,7 @@ async def begin(self, settings: Optional[BaseRequestSettings] = None) -> "QueryT
6058
return self
6159

6260
async def commit(self, settings: Optional[BaseRequestSettings] = None) -> None:
63-
"""WARNING: This API is experimental and could be changed.
64-
65-
Calls commit on a transaction if it is open otherwise is no-op. If transaction execution
61+
"""Calls commit on a transaction if it is open otherwise is no-op. If transaction execution
6662
failed then this method raises PreconditionFailed.
6763
6864
:param settings: An additional request settings BaseRequestSettings;
@@ -81,9 +77,7 @@ async def commit(self, settings: Optional[BaseRequestSettings] = None) -> None:
8177
await self._commit_call(settings)
8278

8379
async def rollback(self, settings: Optional[BaseRequestSettings] = None) -> None:
84-
"""WARNING: This API is experimental and could be changed.
85-
86-
Calls rollback on a transaction if it is open otherwise is no-op. If transaction execution
80+
"""Calls rollback on a transaction if it is open otherwise is no-op. If transaction execution
8781
failed then this method raises PreconditionFailed.
8882
8983
:param settings: An additional request settings BaseRequestSettings;
@@ -111,9 +105,7 @@ async def execute(
111105
concurrent_result_sets: Optional[bool] = False,
112106
settings: Optional[BaseRequestSettings] = None,
113107
) -> AsyncResponseContextIterator:
114-
"""WARNING: This API is experimental and could be changed.
115-
116-
Sends a query to Query Service
108+
"""Sends a query to Query Service
117109
118110
:param query: (YQL or SQL text) to be executed.
119111
:param parameters: dict with parameters and YDB types;

ydb/query/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
class QueryClientSync:
3737
def __init__(self, driver: common_utils.SupportedDriverType, query_client_settings: QueryClientSettings = None):
38-
logger.warning("QueryClientSync is an experimental API, which could be changed.")
3938
self._driver = driver
4039
self._settings = query_client_settings
4140

ydb/query/pool.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def __init__(self, driver: common_utils.SupportedDriverType, size: int = 100):
3333
:param size: Max size of Session Pool.
3434
"""
3535

36-
logger.warning("QuerySessionPool is an experimental API, which could be changed.")
3736
self._driver = driver
3837
self._queue = queue.Queue()
3938
self._current_size = 0
@@ -48,9 +47,7 @@ def _create_new_session(self, timeout: Optional[float]):
4847
return session
4948

5049
def acquire(self, timeout: Optional[float] = None) -> QuerySession:
51-
"""WARNING: This API is experimental and could be changed.
52-
53-
Acquire a session from Session Pool.
50+
"""Acquire a session from Session Pool.
5451
5552
:param timeout: A timeout to wait in seconds.
5653
@@ -102,28 +99,21 @@ def acquire(self, timeout: Optional[float] = None) -> QuerySession:
10299
self._lock.release()
103100

104101
def release(self, session: QuerySession) -> None:
105-
"""WARNING: This API is experimental and could be changed.
106-
107-
Release a session back to Session Pool.
108-
"""
102+
"""Release a session back to Session Pool."""
109103

110104
self._queue.put_nowait(session)
111105
logger.debug("Session returned to queue: %s", session._state.session_id)
112106

113107
def checkout(self, timeout: Optional[float] = None) -> "SimpleQuerySessionCheckout":
114-
"""WARNING: This API is experimental and could be changed.
115-
116-
Return a Session context manager, that acquires session on enter and releases session on exit.
108+
"""Return a Session context manager, that acquires session on enter and releases session on exit.
117109
118110
:param timeout: A timeout to wait in seconds.
119111
"""
120112

121113
return SimpleQuerySessionCheckout(self, timeout)
122114

123115
def retry_operation_sync(self, callee: Callable, retry_settings: Optional[RetrySettings] = None, *args, **kwargs):
124-
"""WARNING: This API is experimental and could be changed.
125-
126-
Special interface to execute a bunch of commands with session in a safe, retriable way.
116+
"""Special interface to execute a bunch of commands with session in a safe, retriable way.
127117
128118
:param callee: A function, that works with session.
129119
:param retry_settings: RetrySettings object.
@@ -147,9 +137,7 @@ def execute_with_retries(
147137
*args,
148138
**kwargs,
149139
) -> List[convert.ResultSet]:
150-
"""WARNING: This API is experimental and could be changed.
151-
152-
Special interface to execute a one-shot queries in a safe, retriable way.
140+
"""Special interface to execute a one-shot queries in a safe, retriable way.
153141
Note: this method loads all data from stream before return, do not use this
154142
method with huge read queries.
155143

ydb/query/session.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ def _check_session_status_loop(self, status_stream: _utilities.SyncResponseItera
235235
self._state._change_state(QuerySessionStateEnum.CLOSED)
236236

237237
def delete(self, settings: Optional[BaseRequestSettings] = None) -> None:
238-
"""WARNING: This API is experimental and could be changed.
239-
240-
Deletes a Session of Query Service on server side and releases resources.
238+
"""Deletes a Session of Query Service on server side and releases resources.
241239
242240
:return: None
243241
"""
@@ -249,9 +247,7 @@ def delete(self, settings: Optional[BaseRequestSettings] = None) -> None:
249247
self._stream.cancel()
250248

251249
def create(self, settings: Optional[BaseRequestSettings] = None) -> "QuerySession":
252-
"""WARNING: This API is experimental and could be changed.
253-
254-
Creates a Session of Query Service on server side and attaches it.
250+
"""Creates a Session of Query Service on server side and attaches it.
255251
256252
:return: QuerySession object.
257253
"""
@@ -266,9 +262,7 @@ def create(self, settings: Optional[BaseRequestSettings] = None) -> "QuerySessio
266262
return self
267263

268264
def transaction(self, tx_mode: Optional[base.BaseQueryTxMode] = None) -> QueryTxContext:
269-
"""WARNING: This API is experimental and could be changed.
270-
271-
Creates a transaction context manager with specified transaction mode.
265+
"""Creates a transaction context manager with specified transaction mode.
272266
273267
:param tx_mode: Transaction mode, which is a one from the following choises:
274268
1) QuerySerializableReadWrite() which is default mode;
@@ -299,9 +293,7 @@ def execute(
299293
concurrent_result_sets: bool = False,
300294
settings: Optional[BaseRequestSettings] = None,
301295
) -> base.SyncResponseContextIterator:
302-
"""WARNING: This API is experimental and could be changed.
303-
304-
Sends a query to Query Service
296+
"""Sends a query to Query Service
305297
306298
:param query: (YQL or SQL text) to be executed.
307299
:param syntax: Syntax of the query, which is a one from the following choises:

ydb/query/transaction.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,7 @@ def _ensure_prev_stream_finished(self) -> None:
327327
self._prev_stream = None
328328

329329
def begin(self, settings: Optional[BaseRequestSettings] = None) -> "QueryTxContext":
330-
"""WARNING: This API is experimental and could be changed.
331-
332-
Explicitly begins a transaction
330+
"""Explicitly begins a transaction
333331
334332
:param settings: An additional request settings BaseRequestSettings;
335333
@@ -340,9 +338,7 @@ def begin(self, settings: Optional[BaseRequestSettings] = None) -> "QueryTxConte
340338
return self
341339

342340
def commit(self, settings: Optional[BaseRequestSettings] = None) -> None:
343-
"""WARNING: This API is experimental and could be changed.
344-
345-
Calls commit on a transaction if it is open otherwise is no-op. If transaction execution
341+
"""Calls commit on a transaction if it is open otherwise is no-op. If transaction execution
346342
failed then this method raises PreconditionFailed.
347343
348344
:param settings: An additional request settings BaseRequestSettings;
@@ -361,9 +357,7 @@ def commit(self, settings: Optional[BaseRequestSettings] = None) -> None:
361357
self._commit_call(settings)
362358

363359
def rollback(self, settings: Optional[BaseRequestSettings] = None) -> None:
364-
"""WARNING: This API is experimental and could be changed.
365-
366-
Calls rollback on a transaction if it is open otherwise is no-op. If transaction execution
360+
"""Calls rollback on a transaction if it is open otherwise is no-op. If transaction execution
367361
failed then this method raises PreconditionFailed.
368362
369363
:param settings: An additional request settings BaseRequestSettings;
@@ -391,9 +385,7 @@ def execute(
391385
concurrent_result_sets: Optional[bool] = False,
392386
settings: Optional[BaseRequestSettings] = None,
393387
) -> base.SyncResponseContextIterator:
394-
"""WARNING: This API is experimental and could be changed.
395-
396-
Sends a query to Query Service
388+
"""Sends a query to Query Service
397389
398390
:param query: (YQL or SQL text) to be executed.
399391
:param parameters: dict with parameters and YDB types;

0 commit comments

Comments
 (0)