Skip to content
Closed
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
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ services:
hostname: localhost
environment:
- YDB_ENABLE_COLUMN_TABLES=true
- YDB_USE_IN_MEMORY_PDISKS=true
23 changes: 15 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@
def docker_compose_file(pytestconfig):
return os.path.join(str(pytestconfig.rootdir), "docker-compose.yml")

@pytest.fixture(scope="module")
def docker_compose_up_options():
return ["--remove-orphans"]

@pytest.fixture(scope="module")
def docker_compose_down_options():
return ["--remove-orphans", "--volumes"]

def wait_container_ready(driver):
driver.wait(timeout=30)
driver.wait(timeout=60)

with ydb.SessionPool(driver) as pool:

started_at = time.time()
while time.time() - started_at < 30:
while time.time() - started_at < 60:
try:
with pool.checkout() as session:
session.execute_scheme("create table `.sys_health/test_table` (A int32, primary key(A));")
Expand All @@ -32,12 +39,12 @@ def wait_container_ready(driver):


async def wait_container_ready_async(driver):
await driver.wait(timeout=30)
await driver.wait(timeout=60)

async with ydb.aio.SessionPool(driver, 1) as pool:

started_at = time.time()
while time.time() - started_at < 30:
while time.time() - started_at < 60:
try:
async with pool.checkout() as session:
await session.execute_scheme("create table `.sys_health/test_table` (A int32, primary key(A));")
Expand Down Expand Up @@ -101,11 +108,11 @@ async def driver(endpoint, database, event_loop):
)

driver = ydb.aio.Driver(driver_config=driver_config)
await driver.wait(timeout=15)
await driver.wait(timeout=60)

yield driver

await driver.stop(timeout=10)
await driver.stop(timeout=60)


@pytest.fixture()
Expand All @@ -116,11 +123,11 @@ async def driver_sync(endpoint, database, event_loop):
)

driver = ydb.Driver(driver_config=driver_config)
driver.wait(timeout=15)
driver.wait(timeout=60)

yield driver

driver.stop(timeout=10)
driver.stop(timeout=60)


@pytest.fixture()
Expand Down
2 changes: 2 additions & 0 deletions tests/scheme/scheme_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_tables(self, driver_sync: ydb.Driver, database: str, table_name: str, c
ydb.scheme.SchemeEntryType.EXTERNAL_DATA_SOURCE,
ydb.scheme.SchemeEntryType.VIEW,
ydb.scheme.SchemeEntryType.RESOURCE_POOL,
ydb.scheme.SchemeEntryType.SYS_VIEW,
],
)
def test_scheme_entry(self, scheme_entry_type):
Expand Down Expand Up @@ -75,3 +76,4 @@ def test_scheme_entry(self, scheme_entry_type):
assert scheme_entry.is_external_data_source() == (scheme_entry_type in (et.EXTERNAL_DATA_SOURCE,))
assert scheme_entry.is_view() == (scheme_entry_type in (et.VIEW,))
assert scheme_entry.is_resource_pool() == (scheme_entry_type in (et.RESOURCE_POOL,))
assert scheme_entry.is_sysview() == (scheme_entry_type in (et.SYS_VIEW,))
5 changes: 3 additions & 2 deletions tests/sqlalchemy/test_inspect.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from sqlalchemy import text

import pytest
import ydb

import sqlalchemy as sa


@pytest.mark.skip(reason="Module moved out of sdk repository")
def test_get_columns(driver_sync, sa_engine):
session = ydb.retry_operation_sync(lambda: driver_sync.table_client.session().create())
session.execute_scheme("CREATE TABLE test(id Int64 NOT NULL, value TEXT, num DECIMAL(22, 9), PRIMARY KEY (id))")
Expand All @@ -22,6 +22,7 @@ def test_get_columns(driver_sync, sa_engine):
session.execute_scheme("DROP TABLE test")


@pytest.mark.skip(reason="Module moved out of sdk repository")
def test_query_list(sa_engine):
with sa_engine.connect() as connection:
result = connection.execute(text("SELECT AsList(1, 2, 3, 4) as c"))
Expand Down
407 changes: 375 additions & 32 deletions ydb/_grpc/v3/protos/ydb_export_pb2.py

Large diffs are not rendered by default.

767 changes: 733 additions & 34 deletions ydb/_grpc/v3/protos/ydb_import_pb2.py

Large diffs are not rendered by default.

146 changes: 95 additions & 51 deletions ydb/_grpc/v3/protos/ydb_query_pb2.py

Large diffs are not rendered by default.

49 changes: 32 additions & 17 deletions ydb/_grpc/v3/protos/ydb_scheme_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

306 changes: 175 additions & 131 deletions ydb/_grpc/v3/protos/ydb_table_pb2.py

Large diffs are not rendered by default.

486 changes: 265 additions & 221 deletions ydb/_grpc/v3/protos/ydb_topic_pb2.py

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions ydb/_grpc/v3/ydb_export_v1_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions ydb/_grpc/v3/ydb_export_v1_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def __init__(self, channel):
request_serializer=protos_dot_ydb__export__pb2.ExportToS3Request.SerializeToString,
response_deserializer=protos_dot_ydb__export__pb2.ExportToS3Response.FromString,
)
self.ExportToFs = channel.unary_unary(
'/Ydb.Export.V1.ExportService/ExportToFs',
request_serializer=protos_dot_ydb__export__pb2.ExportToFsRequest.SerializeToString,
response_deserializer=protos_dot_ydb__export__pb2.ExportToFsResponse.FromString,
)


class ExportServiceServicer(object):
Expand All @@ -45,6 +50,14 @@ def ExportToS3(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def ExportToFs(self, request, context):
"""Exports data to file system.
Method starts an asynchronous operation that can be cancelled while it is in progress.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_ExportServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
Expand All @@ -58,6 +71,11 @@ def add_ExportServiceServicer_to_server(servicer, server):
request_deserializer=protos_dot_ydb__export__pb2.ExportToS3Request.FromString,
response_serializer=protos_dot_ydb__export__pb2.ExportToS3Response.SerializeToString,
),
'ExportToFs': grpc.unary_unary_rpc_method_handler(
servicer.ExportToFs,
request_deserializer=protos_dot_ydb__export__pb2.ExportToFsRequest.FromString,
response_serializer=protos_dot_ydb__export__pb2.ExportToFsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Ydb.Export.V1.ExportService', rpc_method_handlers)
Expand Down Expand Up @@ -101,3 +119,20 @@ def ExportToS3(request,
protos_dot_ydb__export__pb2.ExportToS3Response.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def ExportToFs(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/Ydb.Export.V1.ExportService/ExportToFs',
protos_dot_ydb__export__pb2.ExportToFsRequest.SerializeToString,
protos_dot_ydb__export__pb2.ExportToFsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Loading
Loading