LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
fix: Deprecated django tenant schema function replaced (#647)
Chandrasekharan Mc9bfbfda411b
diff --git a/backend/api/deployment_helper.py b/backend/api/deployment_helper.pyindex b1b9a521e..494eb002e 100644--- a/backend/api/deployment_helper.py+++ b/backend/api/deployment_helper.py@@ -89,7 +89,7 @@ class DeploymentHelper(BaseAPIKeyValidator):Returns:- str: The complete API endpoint URL."""- org_schema = connection.get_tenant().schema_name+ org_schema = connection.tenant.schema_namereturn f"{ApiExecution.PATH}/{org_schema}/{api_name}/"@staticmethoddiff --git a/backend/api/models.py b/backend/api/models.pyindex 2119ff85b..a6f417fef 100644--- a/backend/api/models.py+++ b/backend/api/models.py@@ -87,12 +87,12 @@ class APIDeployment(BaseModel):try:original = APIDeployment.objects.get(pk=self.pk)if original.api_name != self.api_name:- org_schema = connection.get_tenant().schema_name+ org_schema = connection.tenant.schema_nameself.api_endpoint = (f"{ApiExecution.PATH}/{org_schema}/{self.api_name}/")except APIDeployment.DoesNotExist:- org_schema = connection.get_tenant().schema_name+ org_schema = connection.tenant.schema_nameself.api_endpoint = f"{ApiExecution.PATH}/{org_schema}/{self.api_name}/"super().save(*args, **kwargs)diff --git a/backend/api_v2/deployment_helper.py b/backend/api_v2/deployment_helper.pyindex e94c84e46..4c6d1698b 100644--- a/backend/api_v2/deployment_helper.py+++ b/backend/api_v2/deployment_helper.py@@ -134,7 +134,7 @@ class DeploymentHelper:Returns:- str: The complete API endpoint URL."""- org_schema = connection.get_tenant().schema_name+ org_schema = connection.tenant.schema_namereturn f"{ApiExecution.PATH}/{org_schema}/{api_name}/"@staticmethoddiff --git a/backend/pipeline/models.py b/backend/pipeline/models.pyindex 8860d027a..bf0dc5494 100644--- a/backend/pipeline/models.py+++ b/backend/pipeline/models.py@@ -91,7 +91,7 @@ class Pipeline(BaseModel):@propertydef api_endpoint(self):- org_schema = connection.get_tenant().schema_name+ org_schema = connection.tenant.schema_namedeployment_endpoint = settings.API_DEPLOYMENT_PATH_PREFIX + "/pipeline/api"api_endpoint = f"{deployment_endpoint}/{org_schema}/{self.id}/"return api_endpointdiff --git a/backend/platform_settings/platform_auth_service.py b/backend/platform_settings/platform_auth_service.pyindex 054291ba8..318c23591 100644--- a/backend/platform_settings/platform_auth_service.py+++ b/backend/platform_settings/platform_auth_service.py@@ -155,7 +155,7 @@ class PlatformAuthenticationService:error: IntegrityError"""try:- organization = connection.get_tenant()+ organization = connection.tenantplatform_key.modified_by = userif action == PlatformServiceConstants.ACTIVATE:active_keys: list[PlatformKey] = PlatformKey.objects.filter(@@ -193,7 +193,7 @@ class PlatformAuthenticationService:Any: List of platform keys."""try:- organization_id = connection.get_tenant().id+ organization_id = connection.tenant.idplatform_keys: list[PlatformKey] = PlatformKey.objects.filter(organization=organization_id)diff --git a/backend/platform_settings/views.py b/backend/platform_settings/views.pyindex 6b4c918fa..8745eafd1 100644--- a/backend/platform_settings/views.py+++ b/backend/platform_settings/views.py@@ -109,7 +109,7 @@ class PlatformKeyViewSet(viewsets.ModelViewSet):is_active = request.data.get(PlatformServiceConstants.IS_ACTIVE)key_name = request.data.get(PlatformServiceConstants.KEY_NAME)- organization: Organization = connection.get_tenant()+ organization: Organization = connection.tenantPlatformAuthHelper.validate_token_count(organization=organization)