Skip to content

Commit e4a051d

Browse files
Added missing delta in api v2 (#759)
1 parent 175c288 commit e4a051d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

backend/api_v2/api_deployment_views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ def get(
8686
response_status = status.HTTP_422_UNPROCESSABLE_ENTITY
8787
if response.execution_status == CeleryTaskState.COMPLETED.value:
8888
response_status = status.HTTP_200_OK
89-
if include_metadata:
90-
response.remove_result_metadata_keys(keys_to_remove=["highlight_data"])
91-
else:
89+
if not include_metadata:
9290
response.remove_result_metadata_keys()
9391
return Response(
9492
data={

backend/api_v2/deployment_helper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from rest_framework.request import Request
1919
from rest_framework.serializers import Serializer
2020
from rest_framework.utils.serializer_helpers import ReturnDict
21+
from utils.constants import Account, CeleryQueue
22+
from utils.local_context import StateStore
2123
from workflow_manager.endpoint_v2.destination import DestinationConnector
2224
from workflow_manager.endpoint_v2.source import SourceConnector
2325
from workflow_manager.workflow_v2.dto import ExecutionResponse
@@ -33,8 +35,11 @@ class DeploymentHelper(BaseAPIKeyValidator):
3335
def validate_parameters(request: Request, **kwargs: Any) -> None:
3436
"""Validate api_name for API deployments."""
3537
api_name = kwargs.get("api_name") or request.data.get("api_name")
38+
org_name = kwargs.get("org_name") or request.data.get("org_name")
3639
if not api_name:
3740
raise InvalidAPIRequest("Missing params api_name")
41+
# Set organization in state store for API
42+
StateStore.set(Account.ORGANIZATION_ID, org_name)
3843

3944
@staticmethod
4045
def validate_and_process(
@@ -162,7 +167,7 @@ def execute_workflow(
162167
hash_values_of_files=hash_values_of_files,
163168
timeout=timeout,
164169
execution_id=execution_id,
165-
include_metadata=include_metadata,
170+
queue=CeleryQueue.CELERY_API_DEPLOYMENTS,
166171
use_file_history=use_file_history,
167172
)
168173
result.status_api = DeploymentHelper.construct_status_endpoint(

0 commit comments

Comments
 (0)