Skip to content

Commit bc06a61

Browse files
authored
Merge pull request #527 from ydb-platform/revert_database_name_modification
Revert "Add backslash to database name if needed"
2 parents 6c77369 + 1c544fe commit bc06a61

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

ydb/driver.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import os
55
from typing import Any # noqa
6-
from typing import Optional
76

87
from . import credentials as credentials_impl, table, scheme, pool
98
from . import tracing
@@ -144,7 +143,7 @@ def __init__(
144143
145144
"""
146145
self.endpoint = endpoint
147-
self.database = self._maybe_add_slash(database)
146+
self.database = database
148147
self.ca_cert = ca_cert
149148
self.channel_options = channel_options
150149
self.secure_channel = _utilities.is_secure_protocol(endpoint)
@@ -170,7 +169,7 @@ def __init__(
170169
self.compression = compression
171170

172171
def set_database(self, database):
173-
self.database = self._maybe_add_slash(database)
172+
self.database = database
174173
return self
175174

176175
@classmethod
@@ -207,15 +206,6 @@ def _update_attrs_by_kwargs(self, **kwargs):
207206
)
208207
setattr(self, key, value)
209208

210-
def _maybe_add_slash(self, database: Optional[str]) -> Optional[str]:
211-
if not database:
212-
return database
213-
214-
if database.startswith("/"):
215-
return database
216-
217-
return f"/{database}"
218-
219209

220210
ConnectionParams = DriverConfig
221211

0 commit comments

Comments
 (0)