From 1c544fe9e5ef909c4688ac74e9250301a2f3dde6 Mon Sep 17 00:00:00 2001 From: Oleg Ovcharuk Date: Wed, 4 Dec 2024 11:26:35 +0300 Subject: [PATCH] Revert "Add backslash to database name if needed" This reverts commit 80743e72a3bab485437ac29d11f1d5a1d039bb77. --- ydb/driver.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ydb/driver.py b/ydb/driver.py index fa116fe3..49bd223c 100644 --- a/ydb/driver.py +++ b/ydb/driver.py @@ -3,7 +3,6 @@ import logging import os from typing import Any # noqa -from typing import Optional from . import credentials as credentials_impl, table, scheme, pool from . import tracing @@ -144,7 +143,7 @@ def __init__( """ self.endpoint = endpoint - self.database = self._maybe_add_slash(database) + self.database = database self.ca_cert = ca_cert self.channel_options = channel_options self.secure_channel = _utilities.is_secure_protocol(endpoint) @@ -170,7 +169,7 @@ def __init__( self.compression = compression def set_database(self, database): - self.database = self._maybe_add_slash(database) + self.database = database return self @classmethod @@ -207,15 +206,6 @@ def _update_attrs_by_kwargs(self, **kwargs): ) setattr(self, key, value) - def _maybe_add_slash(self, database: Optional[str]) -> Optional[str]: - if not database: - return database - - if database.startswith("/"): - return database - - return f"/{database}" - ConnectionParams = DriverConfig