From 14031f2f293f40771e47eb224dc46e2a67a06725 Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Tue, 3 Oct 2023 13:27:09 -0400 Subject: [PATCH] use set for cache instead of list --- singer_sdk/connectors/sql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/singer_sdk/connectors/sql.py b/singer_sdk/connectors/sql.py index b2565e8c0..fa08b73f6 100644 --- a/singer_sdk/connectors/sql.py +++ b/singer_sdk/connectors/sql.py @@ -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: @@ -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