Skip to content

Commit

Permalink
DH-5080/removing db connection validation (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza authored Dec 18, 2023
1 parent 11ea83b commit 5edd9dd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions dataherald/services/sql_generations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
from dataherald.api.types.requests import SQLGenerationRequest
from dataherald.config import System
from dataherald.eval import Evaluator
from dataherald.repositories.database_connections import (
DatabaseConnectionNotFoundError,
DatabaseConnectionRepository,
)
from dataherald.repositories.database_connections import DatabaseConnectionRepository
from dataherald.repositories.prompts import PromptNotFoundError, PromptRepository
from dataherald.repositories.sql_generations import SQLGenerationRepository
from dataherald.sql_database.base import SQLDatabase
Expand All @@ -33,10 +30,6 @@ def create(
raise PromptNotFoundError(f"Prompt {prompt_id} not found")
db_connection_repository = DatabaseConnectionRepository(self.storage)
db_connection = db_connection_repository.find_by_id(prompt.db_connection_id)
if not db_connection:
raise DatabaseConnectionNotFoundError(
f"Database connection {prompt.db_connection_id} not found"
)
database = SQLDatabase.get_sql_engine(db_connection)
if sql_generation_request.sql is not None:
sql_generation = SQLGeneration(
Expand Down

0 comments on commit 5edd9dd

Please sign in to comment.