Skip to content

Commit

Permalink
Added missing delta in api v2 (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-ali-e authored Sep 30, 2024
1 parent 175c288 commit e4a051d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions backend/api_v2/api_deployment_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ def get(
response_status = status.HTTP_422_UNPROCESSABLE_ENTITY
if response.execution_status == CeleryTaskState.COMPLETED.value:
response_status = status.HTTP_200_OK
if include_metadata:
response.remove_result_metadata_keys(keys_to_remove=["highlight_data"])
else:
if not include_metadata:
response.remove_result_metadata_keys()
return Response(
data={
Expand Down
7 changes: 6 additions & 1 deletion backend/api_v2/deployment_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from rest_framework.request import Request
from rest_framework.serializers import Serializer
from rest_framework.utils.serializer_helpers import ReturnDict
from utils.constants import Account, CeleryQueue
from utils.local_context import StateStore
from workflow_manager.endpoint_v2.destination import DestinationConnector
from workflow_manager.endpoint_v2.source import SourceConnector
from workflow_manager.workflow_v2.dto import ExecutionResponse
Expand All @@ -33,8 +35,11 @@ class DeploymentHelper(BaseAPIKeyValidator):
def validate_parameters(request: Request, **kwargs: Any) -> None:
"""Validate api_name for API deployments."""
api_name = kwargs.get("api_name") or request.data.get("api_name")
org_name = kwargs.get("org_name") or request.data.get("org_name")
if not api_name:
raise InvalidAPIRequest("Missing params api_name")
# Set organization in state store for API
StateStore.set(Account.ORGANIZATION_ID, org_name)

@staticmethod
def validate_and_process(
Expand Down Expand Up @@ -162,7 +167,7 @@ def execute_workflow(
hash_values_of_files=hash_values_of_files,
timeout=timeout,
execution_id=execution_id,
include_metadata=include_metadata,
queue=CeleryQueue.CELERY_API_DEPLOYMENTS,
use_file_history=use_file_history,
)
result.status_api = DeploymentHelper.construct_status_endpoint(
Expand Down

0 comments on commit e4a051d

Please sign in to comment.