Skip to content

Commit

Permalink
Revert "Add backslash to database name if needed"
Browse files Browse the repository at this point in the history
This reverts commit 80743e7.
  • Loading branch information
vgvoleg committed Dec 4, 2024
1 parent 6c77369 commit 1c544fe
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions ydb/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1c544fe

Please sign in to comment.