Skip to content

Commit

Permalink
chore(jans-pycloudlib)!: remove spanner support from pycloudlib (#10049)
Browse files Browse the repository at this point in the history
Signed-off-by: iromli <[email protected]>
Co-authored-by: Mohammad Abudayyeh <[email protected]>
Former-commit-id: 33f7818
  • Loading branch information
iromli and moabu authored Nov 6, 2024
1 parent 669a871 commit 5185f23
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 857 deletions.
3 changes: 0 additions & 3 deletions jans-pycloudlib/docs/api/persistence/spanner.md

This file was deleted.

4 changes: 0 additions & 4 deletions jans-pycloudlib/docs/api/wait.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

::: jans.pycloudlib.wait.wait_for_couchbase_conn

::: jans.pycloudlib.wait.wait_for_spanner

::: jans.pycloudlib.wait.wait_for_spanner_conn

::: jans.pycloudlib.wait.wait_for_sql

::: jans.pycloudlib.wait.wait_for_sql_conn
Expand Down
9 changes: 1 addition & 8 deletions jans-pycloudlib/jans/pycloudlib/lock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import backoff

from jans.pycloudlib.lock.couchbase_lock import CouchbaseLock
from jans.pycloudlib.lock.spanner_lock import SpannerLock
from jans.pycloudlib.lock.sql_lock import SqlLock
from jans.pycloudlib.utils import as_boolean
from jans.pycloudlib.persistence.utils import PersistenceMapper
Expand All @@ -33,13 +32,12 @@

_DATETIME_FMT = "%Y-%m-%dT%H:%M:%S.%fZ"

LockAdapter = _t.Union[SqlLock, SpannerLock, CouchbaseLock]
LockAdapter = _t.Union[SqlLock, CouchbaseLock]
"""Lock adapter type.
Currently supports the following classes:
* [SqlLock][jans.pycloudlib.lock.sql_lock.SqlLock]
* [SpannerLock][jans.pycloudlib.lock.spanner_lock.SpannerLock]
* [CouchbaseLock][jans.pycloudlib.lock.couchbase_lock.CouchbaseLock]
"""

Expand Down Expand Up @@ -251,17 +249,13 @@ def adapter(self) -> LockAdapter: # noqa: D412
Supported lock adapter name:
- `sql`: returns an instance of [SqlLock][jans.pycloudlib.lock.sql_lock.SqlLock]
- `spanner`: returns and instance of [SpannerLock][jans.pycloudlib.lock.spanner_lock.SpannerLock]
- `couchbase`: returns and instance of [CouchbaseLock][jans.pycloudlib.lock.couchbase_lock.CouchbaseLock]
"""
_adapter = os.environ.get("CN_OCI_LOCK_ADAPTER") or PersistenceMapper().mapping["default"]

if _adapter == "sql":
return SqlLock()

if _adapter == "spanner":
return SpannerLock()

if _adapter == "couchbase":
return CouchbaseLock()

Expand Down Expand Up @@ -444,7 +438,6 @@ def release(self) -> None:
# avoid implicit reexport disabled error
__all__ = [
"LockManager",
"SpannerLock",
"SqlLock",
"CouchbaseLock",
]
143 changes: 0 additions & 143 deletions jans-pycloudlib/jans/pycloudlib/lock/spanner_lock.py

This file was deleted.

4 changes: 0 additions & 4 deletions jans-pycloudlib/jans/pycloudlib/persistence/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from jans.pycloudlib.persistence.sql import render_sql_properties # noqa: F401
from jans.pycloudlib.persistence.sql import doc_id_from_dn # noqa: F401
from jans.pycloudlib.persistence.sql import SqlClient # noqa: F401
from jans.pycloudlib.persistence.spanner import render_spanner_properties # noqa: F401
from jans.pycloudlib.persistence.spanner import SpannerClient # noqa: F401
from jans.pycloudlib.persistence.utils import PersistenceMapper # noqa: F401
from jans.pycloudlib.persistence.utils import PERSISTENCE_TYPES # noqa: F401
from jans.pycloudlib.persistence.utils import PERSISTENCE_SQL_DIALECTS # noqa: F401
Expand All @@ -26,8 +24,6 @@
"render_sql_properties",
"doc_id_from_dn",
"SqlClient",
"render_spanner_properties",
"SpannerClient",
"PersistenceMapper",
"PERSISTENCE_TYPES",
"PERSISTENCE_SQL_DIALECTS",
Expand Down
Loading

0 comments on commit 5185f23

Please sign in to comment.