Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Fix to rename function (#735)

alid1f679102718
diff --git a/prompt-service/src/unstract/prompt_service/authentication_middleware.py b/prompt-service/src/unstract/prompt_service/authentication_middleware.py
index 3162216cd..a5a2e135c 100644
--- a/prompt-service/src/unstract/prompt_service/authentication_middleware.py
+++ b/prompt-service/src/unstract/prompt_service/authentication_middleware.py
@@ -1,4 +1,4 @@
-from typing import Any, Optional
+from typing import Optional
from flask import Request, current_app
from unstract.prompt_service.config import db
@@ -85,12 +85,3 @@ class AuthenticationMiddleware:
)
schema_name: str = DBUtils.execute_query(query_org)
return schema_name
-
- @staticmethod
- def execute_query(query: str) -> Any:
- cursor = db.execute_sql(query)
- result_row = cursor.fetchone()
- cursor.close()
- if not result_row or len(result_row) == 0:
- return None
- return result_row[0]
diff --git a/prompt-service/src/unstract/prompt_service/db_utils.py b/prompt-service/src/unstract/prompt_service/db_utils.py
index 74372eafd..fada7ff31 100644
--- a/prompt-service/src/unstract/prompt_service/db_utils.py
+++ b/prompt-service/src/unstract/prompt_service/db_utils.py
@@ -24,20 +24,20 @@ class DBUtils:
platform_key_table = f'"{DB_SCHEMA}".{DBTableV2.PLATFORM_KEY}'
organization_table = f'"{DB_SCHEMA}".{DBTableV2.ORGANIZATION}'
- organization_uid: Optional[int] = cls._execute_query(
+ organization_uid: Optional[int] = cls.execute_query(
f"SELECT organization_id FROM {platform_key_table} WHERE key=%s", (token,)
)
if organization_uid is None:
return None, None
- organization_identifier: Optional[str] = cls._execute_query(
+ organization_identifier: Optional[str] = cls.execute_query(
f"SELECT organization_id FROM {organization_table} WHERE id=%s",
(organization_uid,),
)
return organization_uid, organization_identifier
@classmethod
- def _execute_query(cls, query: str, params: tuple = ()) -> Any:
+ def execute_query(cls, query: str, params: tuple = ()) -> Any:
cursor = db.execute_sql(query, params)
result_row = cursor.fetchone()
cursor.close()