diff --git a/examples/aio/session_pool_example.py b/examples/aio/session_pool_example.py index 2458410ef..73207e3a8 100644 --- a/examples/aio/session_pool_example.py +++ b/examples/aio/session_pool_example.py @@ -4,7 +4,6 @@ import ydb.aio import os - queries = [ # Tables description to create """ CREATE table `series` ( diff --git a/examples/basic_example_v1/__main__.py b/examples/basic_example_v1/__main__.py index 85203f379..12b7be2c1 100644 --- a/examples/basic_example_v1/__main__.py +++ b/examples/basic_example_v1/__main__.py @@ -3,7 +3,6 @@ import basic_example import logging - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/basic_example_v1/basic_example.py b/examples/basic_example_v1/basic_example.py index 09a77a672..8acd65852 100644 --- a/examples/basic_example_v1/basic_example.py +++ b/examples/basic_example_v1/basic_example.py @@ -96,9 +96,7 @@ def callee(session): $format(DateTime::FromSeconds(CAST(DateTime::ToSeconds(DateTime::IntervalFromDays(CAST(release_date AS Int16))) AS Uint32))) AS release_date FROM series WHERE series_id = 1; - """.format( - path - ), + """.format(path), commit_tx=True, ) print("\n> select_simple_transaction:") @@ -124,9 +122,7 @@ def callee(session): PRAGMA TablePathPrefix("{}"); UPSERT INTO episodes (series_id, season_id, episode_id, title) VALUES (2, 6, 1, "TBD"); - """.format( - path - ), + """.format(path), commit_tx=True, ) @@ -148,9 +144,7 @@ def callee(session): $format(DateTime::FromSeconds(CAST(DateTime::ToSeconds(DateTime::IntervalFromDays(CAST(air_date AS Int16))) AS Uint32))) AS air_date FROM episodes WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId; - """.format( - path - ) + """.format(path) data_query = ydb.types.DataQuery( query, @@ -196,9 +190,7 @@ def callee(session): $format(DateTime::FromSeconds(CAST(DateTime::ToSeconds(DateTime::IntervalFromDays(CAST(air_date AS Int16))) AS Uint32))) AS air_date FROM episodes WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId; - """.format( - path - ) + """.format(path) prepared_query = session.prepare(query) result_sets = session.transaction(ydb.SerializableReadWrite()).execute( @@ -235,9 +227,7 @@ def callee(session): UPDATE episodes SET air_date = CAST(CurrentUtcDate() AS Uint64) WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId; - """.format( - path - ) + """.format(path) prepared_query = session.prepare(query) # Get newly created transaction id @@ -261,8 +251,7 @@ def callee(session): def create_tables(pool, path): def callee(session): # Creating Series table - session.execute_scheme( - """ + session.execute_scheme(""" PRAGMA TablePathPrefix("{}"); CREATE table `series` ( `series_id` Uint64, @@ -271,14 +260,10 @@ def callee(session): `release_date` Uint64, PRIMARY KEY (`series_id`) ) - """.format( - path - ) - ) + """.format(path)) # Creating Seasons table - session.execute_scheme( - """ + session.execute_scheme(""" PRAGMA TablePathPrefix("{}"); CREATE table `seasons` ( `series_id` Uint64, @@ -288,14 +273,10 @@ def callee(session): `last_aired` Uint64, PRIMARY KEY (`series_id`, `season_id`) ) - """.format( - path - ) - ) + """.format(path)) # Creating Episodes table - session.execute_scheme( - """ + session.execute_scheme(""" PRAGMA TablePathPrefix("{}"); CREATE table `episodes` ( `series_id` Uint64, @@ -305,10 +286,7 @@ def callee(session): `air_date` Uint64, PRIMARY KEY (`series_id`, `season_id`, `episode_id`) ) - """.format( - path - ) - ) + """.format(path)) return pool.retry_operation_sync(callee) diff --git a/examples/basic_example_v2/__main__.py b/examples/basic_example_v2/__main__.py index 95ecf99ef..13a495426 100644 --- a/examples/basic_example_v2/__main__.py +++ b/examples/basic_example_v2/__main__.py @@ -5,7 +5,6 @@ from basic_example_async import run as run_async import logging - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/basic_example_v2/basic_example.py b/examples/basic_example_v2/basic_example.py index 7bb61f69b..28645fd62 100644 --- a/examples/basic_example_v2/basic_example.py +++ b/examples/basic_example_v2/basic_example.py @@ -2,7 +2,6 @@ import ydb import basic_example_data - DropTablesQuery = """ DROP TABLE IF EXISTS series; DROP TABLE IF EXISTS seasons; @@ -100,11 +99,9 @@ def select_simple(pool: ydb.QuerySessionPool): def upsert_simple(pool: ydb.QuerySessionPool): print("\nPerforming UPSERT into episodes...") - pool.execute_with_retries( - """ + pool.execute_with_retries(""" UPSERT INTO episodes (series_id, season_id, episode_id, title) VALUES (2, 6, 1, "TBD"); - """ - ) + """) def select_with_parameters(pool: ydb.QuerySessionPool, series_id, season_id, episode_id): @@ -197,8 +194,7 @@ def drop_tables(pool: ydb.QuerySessionPool): def create_tables(pool: ydb.QuerySessionPool): print("\nCreating table series...") - pool.execute_with_retries( - """ + pool.execute_with_retries(""" CREATE table `series` ( `series_id` Int64, `title` Utf8, @@ -206,12 +202,10 @@ def create_tables(pool: ydb.QuerySessionPool): `release_date` Date, PRIMARY KEY (`series_id`) ) - """ - ) + """) print("\nCreating table seasons...") - pool.execute_with_retries( - """ + pool.execute_with_retries(""" CREATE table `seasons` ( `series_id` Int64, `season_id` Int64, @@ -220,12 +214,10 @@ def create_tables(pool: ydb.QuerySessionPool): `last_aired` Date, PRIMARY KEY (`series_id`, `season_id`) ) - """ - ) + """) print("\nCreating table episodes...") - pool.execute_with_retries( - """ + pool.execute_with_retries(""" CREATE table `episodes` ( `series_id` Int64, `season_id` Int64, @@ -234,8 +226,7 @@ def create_tables(pool: ydb.QuerySessionPool): `air_date` Date, PRIMARY KEY (`series_id`, `season_id`, `episode_id`) ) - """ - ) + """) def run(endpoint, database): diff --git a/examples/basic_example_v2/basic_example_async.py b/examples/basic_example_v2/basic_example_async.py index ad66462a4..9af13546c 100644 --- a/examples/basic_example_v2/basic_example_async.py +++ b/examples/basic_example_v2/basic_example_async.py @@ -2,7 +2,6 @@ import ydb import basic_example_data - DropTablesQuery = """ DROP TABLE IF EXISTS series; DROP TABLE IF EXISTS seasons; @@ -99,11 +98,9 @@ async def select_simple(pool: ydb.aio.QuerySessionPool): async def upsert_simple(pool: ydb.aio.QuerySessionPool): print("\nPerforming UPSERT into episodes...") - await pool.execute_with_retries( - """ + await pool.execute_with_retries(""" UPSERT INTO episodes (series_id, season_id, episode_id, title) VALUES (2, 6, 1, "TBD"); - """ - ) + """) async def select_with_parameters(pool: ydb.aio.QuerySessionPool, series_id, season_id, episode_id): @@ -196,8 +193,7 @@ async def drop_tables(pool: ydb.aio.QuerySessionPool): async def create_tables(pool: ydb.aio.QuerySessionPool): print("\nCreating table series...") - await pool.execute_with_retries( - """ + await pool.execute_with_retries(""" CREATE table `series` ( `series_id` Int64, `title` Utf8, @@ -205,12 +201,10 @@ async def create_tables(pool: ydb.aio.QuerySessionPool): `release_date` Date, PRIMARY KEY (`series_id`) ) - """ - ) + """) print("\nCreating table seasons...") - await pool.execute_with_retries( - """ + await pool.execute_with_retries(""" CREATE table `seasons` ( `series_id` Int64, `season_id` Int64, @@ -219,12 +213,10 @@ async def create_tables(pool: ydb.aio.QuerySessionPool): `last_aired` Date, PRIMARY KEY (`series_id`, `season_id`) ) - """ - ) + """) print("\nCreating table episodes...") - await pool.execute_with_retries( - """ + await pool.execute_with_retries(""" CREATE table `episodes` ( `series_id` Int64, `season_id` Int64, @@ -233,8 +225,7 @@ async def create_tables(pool: ydb.aio.QuerySessionPool): `air_date` Date, PRIMARY KEY (`series_id`, `season_id`, `episode_id`) ) - """ - ) + """) async def run(endpoint, database): diff --git a/examples/cloud-function-trivial-example/index.py b/examples/cloud-function-trivial-example/index.py index 301c630e4..1ffe8e2e6 100644 --- a/examples/cloud-function-trivial-example/index.py +++ b/examples/cloud-function-trivial-example/index.py @@ -1,7 +1,6 @@ import os import ydb - driver_config = ydb.DriverConfig( endpoint=os.getenv("YDB_ENDPOINT"), database=os.getenv("YDB_DATABASE"), diff --git a/examples/coordination/__main__.py b/examples/coordination/__main__.py index fa7a4983d..275576195 100644 --- a/examples/coordination/__main__.py +++ b/examples/coordination/__main__.py @@ -4,7 +4,6 @@ from example_async import run as run_async import logging - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/jsondemo/__main__.py b/examples/jsondemo/__main__.py index 81ccb90e1..eebadd916 100644 --- a/examples/jsondemo/__main__.py +++ b/examples/jsondemo/__main__.py @@ -2,7 +2,6 @@ import argparse import jsondemo - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/jsondemo/jsondemo.py b/examples/jsondemo/jsondemo.py index e321e5f3e..2d4b9edb4 100644 --- a/examples/jsondemo/jsondemo.py +++ b/examples/jsondemo/jsondemo.py @@ -44,9 +44,7 @@ def insert_json_rows(pool: ydb.SessionPool, table_path: str, num: int): inputData.append({"key": i + 1, "jsonb_value": make_json(i)}) qtext = """ DECLARE $input AS List>; -UPSERT INTO `%s` SELECT * FROM AS_TABLE($input);""" % ( - table_path - ) +UPSERT INTO `%s` SELECT * FROM AS_TABLE($input);""" % (table_path) def fun(session: ydb.Session): session.transaction(ydb.SerializableReadWrite()).execute( @@ -61,9 +59,7 @@ def fun(session: ydb.Session): def find_json_row(pool: ydb.SessionPool, table_path: str, id: int): qtext = """ DECLARE $key AS Int32; SELECT jsonb_value FROM `%s` WHERE key=$key; - """ % ( - table_path - ) + """ % (table_path) def fun(session: ydb.Session): rs = session.transaction().execute( diff --git a/examples/pagination/__main__.py b/examples/pagination/__main__.py index a40b2f228..faa530edd 100644 --- a/examples/pagination/__main__.py +++ b/examples/pagination/__main__.py @@ -2,7 +2,6 @@ import argparse import pagination - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/pagination/pagination.py b/examples/pagination/pagination.py index 5e7ef9694..7fa33ed62 100644 --- a/examples/pagination/pagination.py +++ b/examples/pagination/pagination.py @@ -38,9 +38,7 @@ def __init__(self, session, path, limit): $Union = (SELECT * FROM $Part1 UNION ALL SELECT * FROM $Part2); SELECT * FROM $Union ORDER BY `city`, `number` LIMIT $limit; - """.format( - path=self.path - ) + """.format(path=self.path) self.prepared_next_page_query = self.session.prepare(next_page_query) @@ -53,9 +51,7 @@ def get_first_page(self): SELECT * FROM schools ORDER BY `city`, `number` LIMIT $limit; - """.format( - path=self.path - ) + """.format(path=self.path) prepared_query = self.session.prepare(query) result_sets = self.session.transaction(ydb.SerializableReadWrite()).execute( prepared_query, {"$limit": self.limit}, commit_tx=True diff --git a/examples/pagination/sample_data.py b/examples/pagination/sample_data.py index e56b465eb..b1b158342 100644 --- a/examples/pagination/sample_data.py +++ b/examples/pagination/sample_data.py @@ -57,9 +57,7 @@ def fill_table(session, path): number, address FROM AS_TABLE($schoolsData); - """.format( - path=path - ) + """.format(path=path) prepared_query = session.prepare(query) session.transaction(ydb.SerializableReadWrite()).execute( prepared_query, diff --git a/examples/query-stats/main.py b/examples/query-stats/main.py index 5db4d2995..159052c37 100644 --- a/examples/query-stats/main.py +++ b/examples/query-stats/main.py @@ -1,7 +1,6 @@ import os import ydb - SESSION_QUERY = "SELECT 1" TX_QUERY = "SELECT 1" diff --git a/examples/secondary_indexes_builtin/secondary_indexes_builtin.py b/examples/secondary_indexes_builtin/secondary_indexes_builtin.py index 3e874dcd4..56cd751d8 100644 --- a/examples/secondary_indexes_builtin/secondary_indexes_builtin.py +++ b/examples/secondary_indexes_builtin/secondary_indexes_builtin.py @@ -3,7 +3,6 @@ import ydb from concurrent.futures import TimeoutError - FILL_DATA_QUERY = """ --!syntax_v1 PRAGMA TablePathPrefix("{}"); diff --git a/examples/static-credentials/__main__.py b/examples/static-credentials/__main__.py index 900396ed4..c4eab8ab7 100644 --- a/examples/static-credentials/__main__.py +++ b/examples/static-credentials/__main__.py @@ -2,7 +2,6 @@ import argparse from example import run - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/time-series-serverless/parameters.py b/examples/time-series-serverless/parameters.py index 193a78c25..b0797e0fd 100644 --- a/examples/time-series-serverless/parameters.py +++ b/examples/time-series-serverless/parameters.py @@ -2,7 +2,6 @@ from exception import ValidationError - US_IN_MSEC = 1000 diff --git a/examples/topic/writer_async_example.py b/examples/topic/writer_async_example.py index 74b867d2c..f6dbe7a51 100644 --- a/examples/topic/writer_async_example.py +++ b/examples/topic/writer_async_example.py @@ -96,7 +96,7 @@ async def send_messages_and_wait_all_commit_with_results( async def switch_messages_with_many_producers(writers: Dict[str, ydb.TopicWriterAsyncIO], messages: List[str]): - futures = [] # type: List[asyncio.Future] + futures = [] # type: List[asyncio.Future] for msg in messages: # select writer for the msg diff --git a/examples/topic/writer_example.py b/examples/topic/writer_example.py index 8bcacb7dd..704d14246 100644 --- a/examples/topic/writer_example.py +++ b/examples/topic/writer_example.py @@ -135,7 +135,7 @@ def send_messages_and_wait_all_commit_with_results(writer: ydb.TopicWriter): def switch_messages_with_many_producers(writers: Dict[str, ydb.TopicWriter], messages: List[str]): - futures = [] # type: List[Future] + futures = [] # type: List[Future] for msg in messages: # select writer for the msg diff --git a/examples/ttl/__main__.py b/examples/ttl/__main__.py index a25115110..9a9521fbe 100644 --- a/examples/ttl/__main__.py +++ b/examples/ttl/__main__.py @@ -2,7 +2,6 @@ import argparse import ttl - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/ttl/ttl.py b/examples/ttl/ttl.py index bb510d05e..c20a04098 100644 --- a/examples/ttl/ttl.py +++ b/examples/ttl/ttl.py @@ -6,7 +6,6 @@ import ydb import random - EXPIRATION_QUEUE_COUNT = 4 DOC_TABLE_PARTITION_COUNT = 4 diff --git a/examples/ttl_readtable/__main__.py b/examples/ttl_readtable/__main__.py index 5db8a86d7..43b8d298a 100644 --- a/examples/ttl_readtable/__main__.py +++ b/examples/ttl_readtable/__main__.py @@ -2,7 +2,6 @@ import argparse import ttl - if __name__ == "__main__": parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, diff --git a/examples/ttl_readtable/ttl.py b/examples/ttl_readtable/ttl.py index f91e20696..3ecab8947 100644 --- a/examples/ttl_readtable/ttl.py +++ b/examples/ttl_readtable/ttl.py @@ -5,7 +5,6 @@ import ydb - DOC_TABLE_PARTITION_COUNT = 4 DELETE_BATCH_SIZE = 10 diff --git a/test-requirements.txt b/test-requirements.txt index 304cee362..c54040ab6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ attrs==21.2.0 bcrypt==3.2.0 -black==25.11.0 +black==26.10.1 build cached-property==1.5.2 certifi==2024.7.4 diff --git a/tests/auth/test_static_credentials.py b/tests/auth/test_static_credentials.py index 1e2938c9b..f88878ee8 100644 --- a/tests/auth/test_static_credentials.py +++ b/tests/auth/test_static_credentials.py @@ -2,7 +2,6 @@ import ydb from unittest.mock import patch, MagicMock - USERNAME = "root" PASSWORD = "1234" diff --git a/tests/conftest.py b/tests/conftest.py index 70ac196fd..f9a53fba0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -309,16 +309,13 @@ def create_table(s): except ydb.SchemeError: pass - s.execute_scheme( - """ + s.execute_scheme(""" CREATE TABLE %s ( id Int64 NOT NULL, i64Val Int64, PRIMARY KEY(id) ) -""" - % table_name - ) +""" % table_name) pool.retry_operation_sync(create_table) return table_name @@ -341,8 +338,7 @@ def create_table(s): except ydb.SchemeError: pass - s.execute_scheme( - """ + s.execute_scheme(""" CREATE TABLE %s ( id Int64 NOT NULL, i64Val Int64, @@ -352,9 +348,7 @@ def create_table(s): WITH ( STORE = COLUMN ) -""" - % table_name - ) +""" % table_name) pool.retry_operation_sync(create_table) return table_name diff --git a/tests/oauth2_token_exchange/test_token_exchange.py b/tests/oauth2_token_exchange/test_token_exchange.py index c22d5b4f5..617398107 100644 --- a/tests/oauth2_token_exchange/test_token_exchange.py +++ b/tests/oauth2_token_exchange/test_token_exchange.py @@ -11,7 +11,6 @@ from ydb.oauth2_token_exchange import Oauth2TokenExchangeCredentials, FixedTokenSource from ydb.driver import credentials_from_env_variables - TEST_RSA_PRIVATE_KEY_CONTENT = "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQ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ST_EC_PRIVATE_KEY_CONTENT = "-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEIB6fv25gf7P/7fkjW/2kcKICUhHeOygkFeUJ/ylyU3hloAoGCCqGSM49\nAwEHoUQDQgAEvkKy92hpLiT0GEpzFkYBEWWnkAGTTA6141H0oInA9X30eS0RObAa\nmVY8yD39NI7Nj03hBxEa4Z0tOhrq9cW8eg==\n-----END EC PRIVATE KEY-----\n" # noqa: E501 diff --git a/tests/query/test_query_parameters.py b/tests/query/test_query_parameters.py index 0b75f82ff..b102787c7 100644 --- a/tests/query/test_query_parameters.py +++ b/tests/query/test_query_parameters.py @@ -3,7 +3,6 @@ import pytest import ydb - query_template = "DECLARE $a as %s; SELECT $a AS value" diff --git a/tests/slo/src/__main__.py b/tests/slo/src/__main__.py index dd1ae0b78..063be75f7 100644 --- a/tests/slo/src/__main__.py +++ b/tests/slo/src/__main__.py @@ -4,7 +4,6 @@ from options import parse_options from root_runner import run_from_args - if __name__ == "__main__": args = parse_options() gc.disable() diff --git a/tests/test_disable_discovery.py b/tests/test_disable_discovery.py index 4c30b3a61..a27c48ca8 100644 --- a/tests/test_disable_discovery.py +++ b/tests/test_disable_discovery.py @@ -4,7 +4,6 @@ import asyncio from ydb import _apis - TEST_ERROR = "Test error" TEST_QUERY = "SELECT 1 + 2 AS sum" diff --git a/ydb/_topic_writer/topic_writer_asyncio_test.py b/ydb/_topic_writer/topic_writer_asyncio_test.py index 5c77fc2f1..957c8747f 100644 --- a/ydb/_topic_writer/topic_writer_asyncio_test.py +++ b/ydb/_topic_writer/topic_writer_asyncio_test.py @@ -50,7 +50,6 @@ from .._constants import DEFAULT_INITIAL_RESPONSE_TIMEOUT - FAKE_TRANSACTION_IDENTITY = TransactionIdentity( tx_id="transaction_id", session_id="session_id", diff --git a/ydb/aio/_utilities.py b/ydb/aio/_utilities.py index e3e6699eb..74f6cb291 100644 --- a/ydb/aio/_utilities.py +++ b/ydb/aio/_utilities.py @@ -6,7 +6,6 @@ from .. import resolver - logger = logging.getLogger(__name__) diff --git a/ydb/convert.py b/ydb/convert.py index 66ecf5625..e2709e97b 100644 --- a/ydb/convert.py +++ b/ydb/convert.py @@ -4,7 +4,6 @@ from . import issues, types, _apis - _SHIFT_BIT_COUNT = 64 _SHIFT = 2**64 _SIGN_BIT = 2**63 diff --git a/ydb/dbapi/cursor.py b/ydb/dbapi/cursor.py index 92c471d56..e9f5f713b 100644 --- a/ydb/dbapi/cursor.py +++ b/ydb/dbapi/cursor.py @@ -8,7 +8,6 @@ import ydb from .errors import DatabaseError - LOGGER = logging.getLogger(__name__) diff --git a/ydb/oauth2_token_exchange/token_exchange.py b/ydb/oauth2_token_exchange/token_exchange.py index 318f825d3..a0385b210 100644 --- a/ydb/oauth2_token_exchange/token_exchange.py +++ b/ydb/oauth2_token_exchange/token_exchange.py @@ -14,7 +14,6 @@ from ydb import credentials, tracing, issues # noqa: E402 from .token_source import TokenSource, FixedTokenSource, JwtTokenSource # noqa: E402 - # method -> is HMAC _supported_uppercase_jwt_algs = { "HS256": True, diff --git a/ydb/resolver.py b/ydb/resolver.py index d55de3895..40a049807 100644 --- a/ydb/resolver.py +++ b/ydb/resolver.py @@ -10,7 +10,6 @@ from typing import Any, ContextManager, List, Optional, Iterator from . import connection as conn_impl, driver, issues, settings as settings_impl, _apis - # Workaround for good IDE and universal for runtime if typing.TYPE_CHECKING: from ._grpc.v4.protos import ydb_discovery_pb2 diff --git a/ydb/sqlalchemy/__init__.py b/ydb/sqlalchemy/__init__.py index d1fc4c90d..60dd17efe 100644 --- a/ydb/sqlalchemy/__init__.py +++ b/ydb/sqlalchemy/__init__.py @@ -5,7 +5,6 @@ from __future__ import absolute_import, unicode_literals - try: import ydb from ydb.dbapi.errors import NotSupportedError diff --git a/ydb/table.py b/ydb/table.py index 0346e8e0b..b4ddd366b 100644 --- a/ydb/table.py +++ b/ydb/table.py @@ -919,42 +919,42 @@ def __init__(self): self._allow_truncated_result = convert._default_allow_truncated_result def with_native_timestamp_in_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._native_timestamp_in_result_sets = enabled return self def with_native_interval_in_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._native_interval_in_result_sets = enabled return self def with_native_json_in_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._native_json_in_result_sets = enabled return self def with_native_date_in_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._native_date_in_result_sets = enabled return self def with_native_datetime_in_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._native_datetime_in_result_sets = enabled return self def with_client_query_cache(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._client_query_cache_enabled = enabled return self def with_lazy_result_sets(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._make_result_sets_lazy = enabled return self def with_allow_truncated_result(self, enabled): - # type:(bool) -> ydb.TableClientSettings + # type: (bool) -> ydb.TableClientSettings self._allow_truncated_result = enabled return self diff --git a/ydb/types.py b/ydb/types.py index a34e49a59..b13829d9a 100644 --- a/ydb/types.py +++ b/ydb/types.py @@ -15,7 +15,6 @@ from . import table - # Workaround for good IDE and universal for runtime if typing.TYPE_CHECKING: from ._grpc.v4.protos import ydb_value_pb2