Skip to content

Commit

Permalink
use set for cache instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 committed Oct 3, 2023
1 parent d68e68f commit 14031f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
self._config: dict[str, t.Any] = config or {}
self._sqlalchemy_url: str | None = sqlalchemy_url or None
self._table_cols_cache: dict[str, dict[str, sqlalchemy.Column]] = {}
self._schema_cache: list = []
self._schema_cache: set = {}

@property
def config(self) -> dict:
Expand Down Expand Up @@ -587,7 +587,7 @@ def schema_exists(self, schema_name: str) -> bool:
True if the database schema exists, False if not.
"""
if schema_name not in self._schema_cache:
self._schema_cache = sqlalchemy.inspect(self._engine).get_schema_names()
self._schema_cache = set(sqlalchemy.inspect(self._engine).get_schema_names())

return schema_name in self._schema_cache

Expand Down

0 comments on commit 14031f2

Please # to comment.