Skip to content

Commit

Permalink
edge cases caught
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 2, 2024
1 parent eecc72e commit a57e25b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion backend/danswer/db/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ def get_session_with_tenant(
tenant_id: str | None = None,
) -> Generator[Session, None, None]:
"""Generate a database session with the appropriate tenant schema set."""

engine = get_sqlalchemy_engine()
if tenant_id is None:
tenant_id = current_tenant_id.get()
Expand Down
4 changes: 2 additions & 2 deletions backend/danswer/db/search_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from danswer.configs.model_configs import OLD_DEFAULT_DOCUMENT_ENCODER_MODEL
from danswer.configs.model_configs import OLD_DEFAULT_MODEL_DOC_EMBEDDING_DIM
from danswer.configs.model_configs import OLD_DEFAULT_MODEL_NORMALIZE_EMBEDDINGS
from danswer.db.engine import get_sqlalchemy_engine
from danswer.db.engine import get_session_with_tenant
from danswer.db.llm import fetch_embedding_provider
from danswer.db.models import CloudEmbeddingProvider
from danswer.db.models import IndexAttempt
Expand Down Expand Up @@ -152,7 +152,7 @@ def get_all_search_settings(db_session: Session) -> list[SearchSettings]:

def get_multilingual_expansion(db_session: Session | None = None) -> list[str]:
if db_session is None:
with Session(get_sqlalchemy_engine()) as db_session:
with get_session_with_tenant() as db_session:
search_settings = get_current_search_settings(db_session)
else:
search_settings = get_current_search_settings(db_session)
Expand Down

0 comments on commit a57e25b

Please sign in to comment.